Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- struct couples {
- string name;
- int age;
- couples *spouse;
- };
- couples female, male, m_age, f_age;
- couples *pmale, *pfemale;
- for (int a=0; a<3; a++)
- {pmale = ♂
- cout << "Enter male name: " << endl;
- cin >> male.name;
- cout << "Enter male age: " << endl;
- cin >> m_age.age;}
- for (int a=0; a<3; a++)
- {pfemale = ♀
- cout << "Enter female name: " << endl;
- cin >> female.name;
- cout << "Enter female age: " << endl;
- cin >> f_age.age;}
- for (int b=0; b<3; b++)
- {cout << "Enter the wives of the males: " << endl;
- cin >> pfemale->name;}
- for (int a=0; a<3; a++)
- {cout << male.name << "-" << m_age.age << ", " << female.name << "-" << f_age.age << endl;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement