Advertisement
Sinux1

Lab8.cpp

Apr 7th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.     int main()
  6. {
  7.  
  8.     string name_list[20];
  9.     int num_names;
  10.  
  11.     cout << "How many numbers?" << endl;
  12.     cin >> num_names;
  13.  
  14.  
  15.     for (int subscript = 0; subscript < num_names; subscript++)
  16.     {
  17.             cout << "Enter number " << subscript  << endl;
  18.             cin >> name_list[subscript];
  19.     }
  20.  
  21.     cout << "You entered: " << endl;
  22.  
  23.     for (int subscript = num_names - 1; subscript >= 0; subscript--)
  24.     {
  25.         cout << name_list[subscript] << endl;
  26.     }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement