Aleksandr_Grigoryev

ДЗ #7 (две равные строки)

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