Home > other >  Sentence inversion Python programming problem - solving
Sentence inversion Python programming problem - solving

Time:04-08

 

[title description]

Will be given a line of English sentences, sentence the words of the inversion, the letters in each word then reversed after the output, such as input sentence as We are family, the output should be ylimaf era eW,



Note: each English word consists only of lowercase or uppercase letters, each separated by one or more Spaces between words and the sentence consists only of lowercase letters and Spaces, and the maximum length of each sentence is 1000,



[input format]

The first line, enter a positive integer N (N<=10), said N group test data, there is a blank line between each test data,

Each set of test data, the first line of the input is a positive integer m (m<=10), said the next m lines English sentence need to reverse,

Then enter the group test data m line of the sentence,



Output format []

Total output data output N group, each group m lines of output data, corresponding to each set of m line of the input sentence and output in the sentence, (reverse) separated with a space between words, there can be no Spaces, at the end of the



Note: each group separated by a blank line between test cases, and finally a set of test data output after not output a blank line,



[sample input]

2

3

Simulation results remained negligible that

Our location aware coding -based

Multicast algorithms are very effcient



2

To be or not To be

This is a question





[sample output]

Taht detartsnomed stluser noitalumiS

Desab gnidoc erawa noitacol ruo

Tneicffe yrev era smhtirogla tsacitlum



Eb ot ton ro eb ot

Noitseuq a si sihT
  • Related