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 5460KB
stdin
50109334
50087079
50090743
50131369
50145236
50437189
50006007
50103642
50502699
50299601
50303216
50394528
51472372
50853332
51257103
51426711
51037369
stdout
50109334,50087079,50090743,50131369,50145236,50437189,50006007,50103642,50502699,50299601,50303216,50394528

51472372,50853332,51257103,51426711,51037369

hello