fork(1) 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 5356KB
stdin
50123426
50047076
50363666
50499236
50221662
50237942
50265014
50306147
50529043
50504426
50698469
50013113
50190193
50217286
50066093
50054758
50419582
50424101
50641181
50235197
50034495
50254668
50192477
50356255
50216539
50498871
50296773
50229991
50191851
50139220
50223980
50066779
50234282
stdout
50123426,50047076,50363666,50499236,50221662,50237942,50265014,50306147,50529043,50504426,50698469,50013113

50190193,50217286,50066093,50054758,50419582,50424101,50641181,50235197,50034495,50254668,50192477,50356255

50216539,50498871,50296773,50229991,50191851,50139220,50223980,50066779,50234282

hello