fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iterator>
  4. #include <vector>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8. int main(int n,char *p[])
  9. {
  10. ifstream fin;
  11. if(n>1)
  12. {
  13. fin.open(p[1]);
  14. cin.rdbuf(fin.rdbuf());
  15. }
  16. vector<vector<int>> tb(5,vector<int>(6));
  17. istream_iterator<int> sin(cin);
  18. for(vector<int> &row:tb) for(int &val:row) val=*(sin++);
  19. ostream_iterator<int> sout(cout," ");
  20. for(const vector<int> &row:tb)
  21. {
  22. for(const int &val:row) *(sout++)=val;
  23. cout<<endl;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 4476KB
stdin
3 4 5 7 9 6
4 6 5 3 4 6
2 7 6 4 3 1
3 4 5 3 4 3
3 4 5 3 4 5
stdout
3 4 5 7 9 6 
4 6 5 3 4 6 
2 7 6 4 3 1 
3 4 5 3 4 3 
3 4 5 3 4 5