请问这题怎么做
怎么实现 先读入一行输入然后储存在char数组中,并反向打印。题目要求用带有%c转换符的scanf().
我现在只自学到循环语句,请不要用太高级的代码:)
#include<stdio.h> #include<string.h> int main(void) { char a[20]; scanf("%s",a); int i; for(i=strlen(a)-1;i>=0;i--) printf("%c",a[i]); printf("\n"); system("pause"); return 0; }
[此贴子已经被作者于2018-4-24 17:50编辑过]