Advertisement
Guest User

Untitled

a guest
Dec 27th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7.     struct couples {
  8.         string name;
  9.         int age;
  10.         couples *spouse;
  11.     };
  12.  
  13.     couples female, male, m_age, f_age;
  14.     couples *pmale, *pfemale;
  15.  
  16.     for (int a=0; a<3; a++)
  17.     {pmale = &male;
  18.     cout << "Enter male name: " << endl;
  19.     cin >> male.name;
  20.     cout << "Enter male age: " << endl;
  21.     cin >> m_age.age;}
  22.  
  23.     for (int a=0; a<3; a++)
  24.     {pfemale = &female;
  25.     cout << "Enter female name: " << endl;
  26.     cin >> female.name;
  27.     cout << "Enter female age: " << endl;
  28.     cin >> f_age.age;}
  29.  
  30.     for (int b=0; b<3; b++)
  31.     {cout << "Enter the wives of the males: " << endl;
  32.     cin >> pfemale->name;}
  33.  
  34.    
  35.  
  36.     for (int a=0; a<3; a++)
  37.     {cout << male.name << "-" << m_age.age << ", " << female.name << "-" << f_age.age << endl;}
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement