/*013-sentence Reverse order topic Description An English sentence is emitted in reverse sequence in words. For example "I am a boy", in reverse order after the "Boy a AM I" all the words are separated by a space, the statement in addition to the English letter, no longer contain other characters interface Description/** * Inverted sentence * * @param sentence original sentence * @return inverted sentence *//*public string Reverse (string sentence); Input Description: An English sentence is emitted in reverse order by word. Output Description: Get the sentence input example: I am a boy output example: Boy a am i*///c version #include <stdio.h> #include <string.h>int main (void) {Char St R[1000];int i;gets (str); for (i = strlen (str)-1;i >= 0;i--) {if (str[i] = = ') {str[i] = ';p rintf ("%s", str + i + 1);} }printf ("%s", str); return 0;}
This article is from the "Similarities" blog, please be sure to keep this source http://yutianheji.blog.51cto.com/9580523/1829147
013-Reverse sentence