Aleksandr_Grigoryev

дз №5 (строка из '0')

Feb 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a[5][5];
  6.     for (int i = 0; i <3; i++)
  7.         for (int j = 0; j <3; j++)
  8.             cin >> a[i][j];
  9.     cout << endl;
  10.     bool b, q;
  11.     b = false;
  12.     for (int i = 0; i < 3 && !b; i++)
  13.     {
  14.         q = true;
  15.         for (int j = 0; j < 3 && q; j++)
  16.             for (int k = 0; k < 3; k++)
  17.             {
  18.                 if (a[i][k] != 0)
  19.                     q = false;
  20.                 b = q;
  21.             }
  22.     }
  23.     for (int i = 0; i < 3; i++)
  24.     {
  25.         for (int j = 0; j < 3; j++)
  26.             cout << a[i][j];
  27.         cout << endl;
  28.     }
  29.    
  30.     if (b) cout << "YEs";
  31.     else cout << "Stupid boy";
  32.  
  33.     system("pause");
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment