Alexandre_lsv

Untitled

Feb 22nd, 2016
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4. int main(int argc, char *argv[])
  5. {
  6.     list<list<int>> listoflist;
  7.     for (int i=0; i<3; i++){
  8.         list<int> templist;
  9.         for (int j=0; j<3; j++){
  10.             templist.push_back(rand()%10);
  11.         }
  12.         listoflist.push_back(templist);
  13.     }
  14.     bool b=true;
  15.     for(auto& a : listoflist)
  16.     {
  17.        for (auto&n:a){
  18.            cout << n << " ";
  19.            if (n%2) {
  20.                b=false;
  21.                //break;
  22.            }
  23.           // if (!b) break;
  24.        }
  25.        cout << endl;
  26.     }
  27.     cout << (b?"Yes":"No") << endl;
  28.     return 0;
  29. }
Add Comment
Please, Sign In to add comment