#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
char a[100], b[100]; //a存原数组,b为空数组
gets(a); //向a数组传值
int i, j;
//i的起始地址为最后1位,j的起始地址为0;当i走到-1时退出循环;i向前移动,j向后移动
for (i = strlen(a) - 1, j = 0; i >=0 ; i--, j++) {
b[j] = a[i]; //将a[i]赋值给b[j]
}
b[j] = '\0'; //手动为b数组尾部添加'\0'结束符
puts(b); //输出b数组
return 0;
}
10-18
9816
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-28
08-08
1504
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)