- 总时间限制: 1000ms 内存限制: 65536kB
- 描述
-
输入一个句子(一行),将句子中的每一个单词翻转后输出。
- 输入
- 只有一行,为一个字符串,不超过500个字符。单词之间以空格隔开。
- 输出
- 翻转每一个单词后的字符串,单词之间的空格需与原文一致。
- 样例输入
-
hello world
- 样例输出
-
olleh dlrow
1 #include <iostream> 2 #include<stdio.h> 3 #include<string.h> 4 using namespace std; 5 6 int main() 7 { 8 int i,j,k; 9 char s[505]; 10 int f; 11 gets(s); 12 //printf("%s ",s); 13 14 i=0; 15 f=0; 16 while(s[i]!='