#include<stdio.h>
#include<string.h>//预处理计算字符长度
int main()
{
char s[100] = { 0 };//创建字符串数组
scanf_s("%s", &s);//输入字符串数组
int n;
n = strlen(s);//字符串长度计算
int i;
for (i = n; i >= 0; i--) {
printf("%c", s[i]);
}//通过for循环反向输出一个个单个字符串
return 0;
}
关于字符串反向输出
最新推荐文章于 2023-12-20 20:49:19 发布