Advertisement
evgenko

School

Jun 5th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void schools(int a[])
  5. {
  6.    for (int i=0; i<10; i++)
  7.     {
  8.         cout << "Vvedi nomer shkoli luboi: ";
  9.         cin >> a[i];
  10.         cout << endl;
  11.     }
  12. }
  13.  
  14. void poisk_school(int a[],int ichem_school,bool&znau)
  15. {
  16.     for (int i=0; i<10; i++)
  17.     {
  18.         if (ichem_school==a[i])
  19.         {
  20.             znau=true;
  21.             cout << "Ja znaiu tvoi shkolu";
  22.             break;
  23.         }
  24.     }
  25. }
  26. int main()
  27. {
  28.     int school[10];
  29.     int yshool;
  30.     bool znau = false;
  31.     schools(school);
  32.     cout << "Vvedi nomer tvoie school: ";
  33.     cin >> yshool;
  34.     poisk_school(school,yshool,znau);
  35.     if (znau==false)
  36.     cout<< "Ne znau tvoi shkolu";
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement