/* List9-9に示した関数をもとにして、文字列を後ろから逆に表示する ("SEC"を受け取ったら"CES"と表示する関数put_rstringを作成せよ。 */ #include void put_rstring(const char str[]) { unsigned i = 0; while(str[i]) i++; i--; while(str[i]) putchar(str[i--]); } int main(void) { char str[128]; printf("文字列を入力してください:"); scanf("%s", str); printf("逆にした文字列は"); put_rstring(str); printf("です。\n"); return 0; }