Word Reversal

For each list of words, output aline with each word reversed without changing the order of the words.


This problem contains multiple test cases!

The firstline of a multiple input is an integer N, then a blank line followed by N inputblocks. Each input block is in the format indicated in the problem description.There is a blank line between input blocks.

Theoutput format consists of N output blocks. There is a blank line between outputblocks.


Input

You willbe given a number of test cases. The first line contains a positive integerindicating the number of cases to follow. Each case is given on a linecontaining a list of words separated by one space, and each word contains onlyuppercase and lowercase letters.


Output

For eachtest case, print the output on one line.


Sample Input

1

3
I am happy today
To be or not to be
I want to win the practice contest


Sample Output

I mayppah yadot
oT eb ro ton ot eb
I tnaw ot niw eht ecitcarp tsetnoc


【思路】:没有用调用函数,直接强行遍历的算。

1.输入一行数据,要用cin.getline(x,n)x是类型名,后面n的大小。getline头文件是stdio.h

2.注意getchar的使用

3.自己犯了脑残错误,=和==搞混,菜啊。。。。


#include
#include                                                          //   strlen的头文件!!                                                          
#include                                                           //   getline的头文件!!!
using namespace std;
int main(){
	int n,i,j,k,l;
	char words[1024];
	cin>>n;
	getchar();                                                           //从这一行还是输入字符串,不然前面3也算。
	for(i=0;i=index;k--){
					cout<flag){                                    //注意这点,标示用了没有。
				for(k=l-1;k>=index;k--){
					cout<=0;k--){
					cout<


你可能感兴趣的:(Coding)