#include <iostream>
#include <string>
using namespace std;
void getMemory(string*& str, int n){
str = new string[n];
}
void outputLine(string*& str, int countStr){
int i, j;
for (i = 0; i < countStr; i++){
for (j = 0; j < str[i].length(); j++){
cout << str[i].substr(str[i].length() - j - 1, 1);
}
cout << endl;
}
}
int main()
{
int i, countStr = 0;
string *str;
cout << "Enter the numbers of rows: ";
cin >> countStr;
getMemory(str, countStr);
for (i = 0; i < countStr; i++){
cin.ignore();
getline(cin,str[i]);
if (str[i].length() > 80){
cout << "String more than 80 characters!" << endl;
return 0;
}
}
outputLine(str, countStr);
delete[] str;
return 0;
}