Advertisement
mostlabs

14-2-3

May 5th, 2020
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. struct word
  8. {
  9.     string country;
  10.     string city;
  11.  
  12. };
  13. int main()
  14. {
  15.     const int n = 26;
  16.  
  17.     word number[n];
  18.  
  19.     for(int i=0; i < n; i++){
  20.          cout << "country" << i+1 <<":";
  21.     cin >> number[i].country;
  22.           cout << "city" << i+1 << ":";
  23.     cin >> number[i].city;
  24.     }
  25.  
  26.     for(int i=0; i < n; i++){
  27.  
  28.         if(number[i].country == "italy")
  29.     cout << number[i].country <<"-" << number[i].city <<  endl;
  30.  
  31.     }
  32.  
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement