include iostream include string using namespace std void outputLine st

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <string>
using namespace std;
void outputLine(string str){
int j;
for (j = 0; j < str.length(); j++){
cout << str.substr(str.length() - j - 1, 1);
}
cout << endl;
}
int main()
{
int i, countStr = 0;
string *str;
cout << "Enter the numbers of rows: ";
cin >> countStr;
str = new string[countStr];
for (i = 0; i < countStr; i++){
cin.ignore();
getline(cin,str[i]);
if (str[i].length() > 10){
cout << "String more than 80 characters!" << endl;
return 0;
}
}
for (i = 0; i < countStr; i++){
outputLine(str[i]);
}
delete[] str;
return 0;
}