Ychenik

Школы

Mar 23rd, 2019
48
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.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int flag = 2;
  8.     int a[10];
  9.     int b = 0;
  10.     for(int i = 0; i < 10; i++)
  11.     {
  12.         cout << "napishu nomer shkol " << endl;
  13.         cin >> a[i];
  14.     }
  15.     cout << "napishu nomer svoeg shkolu " << endl;
  16.     cin >> b;
  17.     for(int t = 0; t < 10; t++)
  18.     {
  19.         if(a[t] == b)
  20.         {
  21.             flag = 1;
  22.             break;
  23.         }
  24.     }
  25.     if (flag == 1)
  26.     {
  27.         cout << "i znay ety shkoly";
  28.     }
  29.     if (flag == 2)
  30.     {
  31.         cout << "i ne znay ety shkoly";
  32.     }
  33. }
Add Comment
Please, Sign In to add comment