Home > Back-end > Program is for the purpose of the user input sentences upside down output, sen an array used to stor
Program is for the purpose of the user input sentences upside down output, sen an array used to stor
Time:09-22
#include Int main () { int i=0; Char sentence [I]; Int j=0; Printf (" input a English sentence: ");
For ((what [I]=getchar ())='? '& & What [I]='! '& & What [I]!='. '; I++) { ; } Char sen_last=what [I]; Printf (" reverse the order of the sentence is: "); int k=0; int m; Char sen [k]. For (j=I - 1; J>=0; J -, k++) { Sen [k]=what [j]; If (sen [k]=='| | sen [k]==', ') { For (m=k; M>=0; M -) { Putchar (sen [m]); } k=0; } } printf("\n"); Printf (" % d % d \ n ", j, k); return 0; }
Program is 14 questions out of the book
CodePudding user response:
for(; (what [I]=getchar ())!='? '& amp; & What [I]!='! '& & What [I]!='. '; I++) { ; }