#include <stdio.h>
#include <string.h>
int main(void)
{
char cszSource[128], cszReverse[128];
char *lpcszChar;
unsigned int unLength, unI;
printf("文字列を入力してください\n");
scanf("%s", cszSource);
puts("反転前は");
printf("%sです\n", cszSource);
unLength = strlen(cszSource);
lpcszChar = &cszSource[unLength - 1];
for(unI=0;unI<=unLength;unI++,*lpcszChar--) {
cszReverse[unI] = *lpcszChar;
}
printf("反転後は\n%sです\n",cszReverse);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KIAppbnQgbWFpbih2b2lkKQp7CiAgICAgICAgY2hhciBjc3pTb3VyY2VbMTI4XSwgY3N6UmV2ZXJzZVsxMjhdOwogICAgICAgIGNoYXIgKmxwY3N6Q2hhcjsKICAgICAgICB1bnNpZ25lZCBpbnQgdW5MZW5ndGgsIHVuSTsKIAogICAgICAgIHByaW50Zigi5paH5a2X5YiX44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GEXG4iKTsKICAgICAgICBzY2FuZigiJXMiLCBjc3pTb3VyY2UpOwogCiAgICAgICAgcHV0cygi5Y+N6Lui5YmN44GvIik7CiAgICAgICAgcHJpbnRmKCIlc+OBp+OBmVxuIiwgY3N6U291cmNlKTsKIAogICAgICAgIHVuTGVuZ3RoID0gc3RybGVuKGNzelNvdXJjZSk7CiAgICAgICAgbHBjc3pDaGFyID0gJmNzelNvdXJjZVt1bkxlbmd0aCAtIDFdOwoKCWZvcih1bkk9MDt1bkk8PXVuTGVuZ3RoO3VuSSsrLCpscGNzekNoYXItLSkJewogICAgICAgICAgICAgICAJY3N6UmV2ZXJzZVt1bkldID0gKmxwY3N6Q2hhcjsKICAgICAgICB9CiAKICAgICAgICBwcmludGYoIuWPjei7ouW+jOOBr1xuJXPjgafjgZlcbiIsY3N6UmV2ZXJzZSk7CiAKICAgICAgICByZXR1cm4gMDsKfQo=