Advertisement
SergeyPGUTI

7.2.7

Dec 5th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <fstream>
  4.  
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     int n;
  12.     string s1;
  13.     cin>>n;
  14.     char **names = new char* [n];
  15.     for (int count = 0; count < n; count++)
  16.         names[count] = new char [20];
  17.  
  18.  
  19.     char in='a';
  20.     for (int i=0;i<n;i++)
  21.     {
  22.         for (int j=0;j<5;j++)
  23.         {
  24.         cin>>names[i][j];
  25.         }
  26.     }
  27.  
  28.     int *ages= new int [n];
  29.  
  30.     for (int j=0;j<n;j++)
  31.     {
  32.         cin>>ages[j];
  33.     }
  34.  
  35.     for (int i=0;i<n;i++)
  36.     {
  37.         for (int j=0;j<5;j++)
  38.         {
  39.         cout<<names[i][j];
  40.         }
  41.         cout<<" "<<ages[i]<<endl;
  42.     }
  43.    return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement