标签:des style blog io ar color os sp for
3 olleh !dlrow m‘I morf .udh I ekil .mca
hello world! I‘m from hdu. I like acm.HintRemember to use getchar() to read ‘\n‘ after the interger T, then you may use gets() to read a line and process it.
#include<stdio.h>
#include<string.h>
char s[1002];
int main()
{
int test,i,j,len,k;
scanf("%d",&test);
getchar();
while(test--)
{
gets(s);
len=strlen(s);
for(i=0,k=0;i<len;i++)
{
if(s[i]==' ')
{
for(j=i-1;j>=k;j--)
{
printf("%c",s[j]);
}
printf(" ");
k=i+1;
}
}
for(j=len-1;j>=k;j--)
printf("%c",s[j]);
printf("\n");
}
return 0;
}标签:des style blog io ar color os sp for
原文地址:http://blog.csdn.net/hdd871532887/article/details/41826219