Advertisement
AndriikoM

Лекція 3, завдання 1

Oct 17th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7.     int a[10];
  8.     int b;
  9.     int k = 0;
  10.     for (int i=0; i<10; i++)
  11.     {
  12.         cout << "Vvedite nomer shkoli: ";
  13.         cin >> a[i];
  14.     }
  15.     cout <<"Vvedite ishcho skholu: ";
  16.     cin >> b;
  17.     for (int i=0; i<10; i++)
  18.     {
  19.         if (a[i]==b)
  20.         {
  21.             cout << "Ya znay skholu";
  22.         }
  23.         else
  24.         {
  25.             k++;
  26.         }
  27.     }
  28.     if (k == 10)
  29.     {
  30.         cout << "Ya ne znay etu skholu";
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement