设为首页 加入收藏

TOP

c语言:输入一个数,从高位向低位输出,如:输入12345,输出1 2 3 4 5
2015-11-23 14:09:59 来源: 作者: 【 】 浏览:33
Tags:语言 输入 一个数 高位 低位 输出 12345
输入一个数,从高位向低位输出,如:输入12345,输出1 ?2 ?3 ?4 ?5
程序:
#include
int main()
{
    int i=0;
    char s[1000000];
    gets(s);
    while(s[i]!=0)
    {
        printf("%c\n",s[i]);
        i++;
    }
    return 0;
}

?

结果:
12345
1
2
3
4
5
?
?
?
? ? ? ? ? ? ?Press any key to continue
234567
2
3
4
5
6
7
?
?
?
? ? ? ? ? ? ?Press any key to continue
?
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇c语言:枚举常量的用法举例 下一篇c语言:2种方法编程及优化;喝汽..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: