69,369
社区成员
发帖
与我相关
我的任务
分享
int main(int argc,char *argv[])
{
char s[10];
int i;
cin >> i;
char ** p = new char*[i];
for (int j=0;j<i;j++)
{
fflush(stdin);
scanf("%[^\n]",s);
p[j] = (char*)malloc(sizeof(s));
strcpy(p[j],s);
}
for (int j=0;j<i;j++)
{
cout << "Result #" << j << endl;
for (int k=strlen(p[j])-1;k>=0;k--)
{
cout << (p[j])[k];
}
cout << endl;
}
delete[] p;
return 0;
}