Reverse in place · インプレイス逆転
Reverse in place
Reverse a C-string in place — change the characters in the same array rather than building a new string. The classic move: a left index at the start and a right index at the end, swap them, then step both toward the middle until they meet.
インプレイでの逆転
Cストリングをインプレイで逆転します——新しいストリングを作成するのではなく、同じ配列内の文字を書き換えます。古典的な手法:左インデックスを先頭に、右インデックスを末尾に設定して交換し、両方が中央で出会うまでそれぞれ中央へ向かって進めます。
Complete void reverse_in_place(char *s) to reverse the C-string s in place (modify the same array). Do not write main. · void reverse_in_place(char *s) を完成させてC文字列 s をインプレイスで逆転します(同じ配列を修正します)。main を書かないでください。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。