fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n = 0,t;
  6. string s[1000], k;
  7. while(cin>>k)
  8. {
  9. s[n]=k;
  10. n++;
  11. }
  12.  
  13. if(n/12>=1)
  14. {
  15. t=0;
  16. int count=0;
  17. string b[13];
  18. for(int i=0;i<n;i++)
  19. {
  20. count++;
  21. if(count<=12)
  22. {
  23. b[t]=s[i];
  24. t++;
  25. // cout<<t<<endl;
  26. }
  27. if(count==12 || i==n-1)
  28. {
  29. for(int j=0;j<t;j++)
  30. {
  31. if(j!=t-1)
  32. cout<<b[j]<<",";
  33. else
  34. cout<<b[j]<<endl;
  35. }
  36. cout<<endl;
  37. t=0;
  38. count=0;
  39. if(i==n-1)
  40. break;
  41. }
  42. }
  43. }
  44. else
  45. {
  46. //string b[10];
  47. for(int j=0;j<n;j++)
  48. {
  49. if(j!=n-1)
  50. cout<<s[j]<<",";
  51. else
  52. cout<<s[j]<<endl;
  53. }
  54. }
  55. cout<<"hello"<<endl;
  56. return 0;
  57. }
  58.  
Success #stdin #stdout 0.01s 5464KB
stdin
50034947
50047576
50001630
50427975
50280111
50268849
50266050
50235111
50281206
50156287
50431250
50591669
50053691
50449791
50318867
50295282
50700966
50173254
50249504
51101025
51382353
50778119
51382951
51440821
50585364
50564449
50170003
51213695
51074305
50510816
50922614
50891775
50999456
50693802
51204220
50995484
51069387
50721863
51221445
stdout
50034947,50047576,50001630,50427975,50280111,50268849,50266050,50235111,50281206,50156287,50431250,50591669

50053691,50449791,50318867,50295282,50700966,50173254,50249504,51101025,51382353,50778119,51382951,51440821

50585364,50564449,50170003,51213695,51074305,50510816,50922614,50891775,50999456,50693802,51204220,50995484

51069387,50721863,51221445

hello