Advertisement
anhkiet2507

Loop C++

Apr 16th, 2022
1,711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1.     for(int i = 0; i < n; i++){
  2.         vector<int> temp;
  3.         do{
  4.             int tmp;
  5.             if(cin >> tmp){
  6.                 temp.push_back(tmp);
  7.             }
  8.         }while(cin && cin.peek()!='\n');
  9.         res.push_back(temp);
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement