C语言字符串反转代码示例
#include <stdio.h>
#include <string.h>
int main()
{
char str[101];
printf('请输入一个字符串:\n');
scanf('%s', str);
int len = strlen(str);
printf('颠倒后的字符串为:');
for (int i = len - 1; i >= 0; i--)
{
printf('%c', str[i]);
}
printf('\n');
return 0;
}
原文地址: https://www.cveoy.top/t/topic/oILw 著作权归作者所有。请勿转载和采集!