一道简单的acm题我还是不会
A. Word Reversal
Time Limit: 1.0 Seconds Memory Limit: 65536K Multiple test files
For each list of words, output a line with each word reversed without changing the order of the words.
Input
You will be given a number of test cases. The first line contains a positive integer indicating the number of cases to follow. Each case is given on a line containing a list of words separated by one space, and each word contains only uppercase and lowercase letters.
Output
For each test case, print the output on one line.
Sample Input
3
I am happy today
To be or not to be
I want to win the practice contest
Sample Output
I ma yppah yadot
oT eb ro ton ot eb
I tnaw ot niw eht ecitcarp tsetnoc
c++中输入一串字符的函数有多种:
C标准函数,存储字符到字符数组中:
char str[100];
scanf("%s", str ) ; //读入一串字符,不能包括空格
gets(str); //输入一行字符,可以有空格,以回车键结束
C++函数,可以存储到字符数组,也可以存储到string类对象中:
string str;
cin >> str ; //读入一串字符,不能包括空格
getline(cin,str ); //输入一行字符,可以有空格,以回车键结束