问答题

将输入的字符串按逆序输出,例如输入abcd,则按dcba顺序输出出来,请完善程序。
#include
#include
int main( )
{
 char *str, s[20]; int n;
    str=s;
    scanf("%s",str);
    n=strlen(str);
    while(--n>=0)
 {
 str=&s[____];
       printf("%c",*str);
    }
    return 0;
}

答案: n
微信扫码免费搜题