Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- void siralama(struct al *a );
- struct al
- {
- string country;
- string city;
- };
- int main()
- {
- struct al a[100];
- for(int i=0; i < 26; i++){
- cout << "country" << i+1 <<":";
- cin >> a[i].country;
- cout << "city" << i+1 << ":";
- cin >> a[i].city;
- }
- siralama(&a[0]);
- return 0;
- }
- void siralama(struct al *a ){
- for(int i=0; i < 26; i++){
- if((*(a+i)).country == "italy"){
- cout <<"italy-city:" << (*(a+i)).city << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement