Advertisement
Norbysweg

T55

Feb 5th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int b[20],n;
  8.     string a[20],x;
  9.     cout<<"n=";
  10.     cin>>n;
  11.     for (int i=0;i<n;i++)
  12.     {
  13.         cout<<"a["<<i<<"]=";
  14.         cin>>a[i];
  15.         cout<<"b["<<i<<"]=";
  16.         cin>>b[i];
  17.     }
  18.     cout<<"nev=";
  19.     cin>>x;
  20.     for (int i=0;i<n;i++)
  21.     {
  22.         if (x==a[i])
  23.         {
  24.             cout<<a[i]<<" telefonszama "<<b[i];
  25.             return 0;
  26.         }
  27.     }
  28.     cout<<x<<" nem talalhato";
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement