#include <stdio.h>
void reverseSentence();
int main() {
printf("Enter a sentence: ");
reverseSentence();
return 0;
}
void reverseSentence() {
char c;
scanf("%c", &c);
if (c != '\n') {
reverseSentence();
printf("%c", c);
}
}
结果:
|
1 2 3 4 |
Enter a sentence: I am a good Guy yuG doog a ma I Process returned 0 (0x0) execution time : 8.566 s Press any key to continue. |