fork(3) download
  1. #include<cstdio>
  2. #include<cstring>
  3. #include<vector>
  4. #include<cstdlib>
  5. #include <sstream>
  6.  
  7. using namespace std;
  8.  
  9. int lw[100],rw[100];
  10. vector<int> l[100],r[100];
  11.  
  12. int main(){
  13.  
  14. int n,i,j,temp;
  15. stringstream stream;
  16. char s[1000],c;
  17. scanf("%d",&n);
  18. scanf("%c",&c);
  19. vector<int>::iterator it;
  20.  
  21. for(i=0;i<n;i++){
  22.  
  23. scanf(" %[^\n]s",s);
  24. stream.clear();
  25. stream.str(s);
  26.  
  27. stream >> lw[i];
  28. while(stream >> temp) {
  29. l[i].push_back(temp);
  30. }
  31.  
  32. scanf(" %[^\n]s",s);
  33. stream.clear();
  34. stream.str(s);
  35.  
  36. stream >> rw[i];
  37. while(stream >> temp) {
  38. r[i].push_back(temp);
  39. }
  40.  
  41. printf("%d\n",lw[i]);
  42. for(it=l[i].begin();it!=l[i].end();it++)
  43. printf("%d\n",*it);
  44.  
  45.  
  46. printf("%d\n",rw[i]);
  47. for(it=r[i].begin();it!=r[i].end();it++)
  48. printf("%d\n",*it);
  49.  
  50. }
  51.  
  52. return 0;}
  53.  
Success #stdin #stdout 0s 3436KB
stdin
4

0 1

0 2

0

0 3

3

0

0

0
stdout
0
0
0
0
0
0
0
0