提交时间:2019-12-22 09:15:09
运行 ID: 3804
#include<iostream> using namespace std; int main(){ short a,c=0,i,j=0; cin>>a; char d,b[a][1001]; for(i=0;i<a;i++){ scanf("%s",b[i]); } for(i=0;i<a;i++){ c=0; j=0; while(b[i][j]!='\0'){ c++; j++; } for(j=0;j<=c/2;j++){ d=b[i][j]; b[i][j]=b[i][c-1-j]; b[i][c-1-j]=d; } } for (i=0;i<a;i++){ printf("%s\n",b[i]); } return 0; }