回复 9楼 阿维
输入了五个字符后,为什么是倒叙输出的
程序代码:
/* 输入一段字符串 然后反向打印该字符串 */
#include <stdio.h>
#include <windows.h>
#include <string.h>
void main()
{
char My_str[50];
int i;
system("title 输入一段字符串 然后反向打印该字符! ");
printf("please input a string:");
scanf("%s",My_str);
i=strlen(My_str);
printf("原字符:%s\n",My_str);
printf("该字符长度:%d bate!\n",i);
printf("反向后的字符:");
for(;i>=0;i--){
printf("%c",My_str[i]);
}
printf("\n");
system("pause");
}这也是一种 输入一段字符后 反序输出它的程序 .







