Advertisement
evgenko

Untitled

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