Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- string arr[100][2];
- cout << "Enter the number of records: ";
- cin >> n;
- for (int i = 0; i < n; i++) {
- cout << "Enter name of " << i + 1 << " person: ";
- cin >> arr[i][0];
- cout << "Enter surname of " << i + 1 << " person: ";
- cin >> arr[i][1];
- }
- cout << "# | Name | Surname\n";
- for (int i = 0; i < n; i++) {
- cout << i + 1;
- for (int j = 0; j < 2; j++) {
- cout << " | " << arr[i][j];
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement