满意答案
9n7j5j3m4o
2013.12.03
采纳率:49% 等级:11
已帮助:15198人
47911 zxl0714 1358 Accepted 164K 15MS G++ 0.46K 2007-04-08 10:32:38
#include
using namespace std;
void reverse(char* ch)
{
int i, len;
char tmp;
len = strlen( ch );
for ( i = 0; i < len / 2; i++ )
{
tmp = ch[ i ];
ch[ i ] = ch[ len - i - 1 ];
ch[ len - i - 1 ] = tmp;
}
}
int main( )
{
int n;
cin >> n;
char data[ 52 ];
cin.getline( data, sizeof( data ) );
while ( n-- )
{
cin.getline( data, sizeof( data ) );
reverse( data );
cout << data << endl;
}
return 0;
}
00分享举报