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 5532KB
stdin
50154222
50033554
50045452
50027710
50025286
50019101
50022964
50030764
50018933
50145331
50144772
50306300
50129462
50254390
50175432
50421885
50357736
50971615
50195331
50174492
50070505
50376104
50144973
50746435
50218126
50254124
50482484
50127884
50336932
50296682
50175362
50162448
50951070
50208661
50481054
50395036
50083275
50340860
50066137
50160591
50232545
50255078
50094783
50186278
50262170
50204152
50394126
50388032
50279337
stdout
50154222,50033554,50045452,50027710,50025286,50019101,50022964,50030764,50018933,50145331,50144772,50306300

50129462,50254390,50175432,50421885,50357736,50971615,50195331,50174492,50070505,50376104,50144973,50746435

50218126,50254124,50482484,50127884,50336932,50296682,50175362,50162448,50951070,50208661,50481054,50395036

50083275,50340860,50066137,50160591,50232545,50255078,50094783,50186278,50262170,50204152,50394126,50388032

50279337

hello