输入一个数,从高位向低位输出,如:输入12345,输出1  2  3  4  5

程序:

#include<stdio.h>

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




本文出自 “岩枭” 博客,请务必保留此出处http://yaoyaolx.blog.51cto.com/10732111/1715562

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐