fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <cstdio>
  4. #include <cstring>
  5. #include <cctype>
  6. using namespace std;
  7.  
  8. struct WS
  9. {
  10. static char skip[];
  11. bool newline;
  12. WS():newline(true) {}
  13. friend istream &operator>>(istream &s,WS &w)
  14. {
  15. w.newline=false;
  16. int ch;
  17. while((ch=s.get())!=EOF)
  18. {
  19. if(ch=='\n') { w.newline=true; break; }
  20. if(strchr(skip,ch)) break;
  21. }
  22. return s;
  23. }
  24. };
  25. char WS::skip[]=";";
  26.  
  27. int main()
  28. {
  29. vector<vector<double> > Tb;
  30. WS ws;
  31. while(cin)
  32. {
  33. if(ws.newline) Tb.resize(Tb.size()+1);
  34. unsigned y=Tb.size()-1,x=Tb[y].size();
  35. Tb[y].resize(x+1);
  36. cin>>Tb[y][x]>>ws;
  37. }
  38. for(unsigned y=0;y<Tb.size();++y,cout<<endl) for(unsigned x=0;x<Tb[y].size();++x) cout<<"\t"<<Tb[y][x];
  39. return 0;
  40. }
  41.  
  42.  
Success #stdin #stdout 0s 3484KB
stdin
11.11;12.12;13.13
21.21;22.22;23.23;24.24
31.31;32.32;33.33
41.41;42.42;43.43
51.51;52.52;53.53
stdout
	11.11	12.12	13.13
	21.21	22.22	23.23	24.24
	31.31	32.32	33.33
	41.41	42.42	43.43
	51.51	52.52	53.53