又学了一招!!!
#include<iostream>
#include<string>
using namespace std;
char a[1005];
int main()
{
int n;
scanf("%d", &n);
while(scanf("%s", a) != EOF)
{
int i;
for(i = strlen(a)-1; i >= 0; i--)
printf("%c", a[i]);
int c;
while(c = getchar(), c == '\n' || c == ' ')//已经把下一个单词的首字母吃掉了
putchar(c);
ungetc(c, stdin);//把吃掉的字母回到标准输入流中
}
return 0;
}
1529

被折叠的 条评论
为什么被折叠?



