我永远喜欢蕾米莉亚


私信TA

用户名:qazqaz123921

访问量:4377

签 名:

等  级
排  名 20685
经  验 655
参赛次数 0
文章发表 2
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:

#include<stdio.h>

int main (void)

{

    int a;

    int b = 0;

    int ch[5] = {0,0,0,0,0};

    int n,n1;

    int x = 0;

    scanf("%d",&a);


    for(n = 1;n/a<=1;n*=10)

       {

            b+=1;

        }


    printf("%d\n",b);

    n/=10;




    while(a>=10)

    {

        ch[x] = a/n;

        a -= ch[x]*n;

        n/=10;

        x+=1;

        while(a/n*10<=1&&a!=0)

        {

            ch[x] = 0;

            x++;

            n/=10;

        }

    }    


    ch[x] = a;

    n1 = 0;


    while(n1<x)

    {

        printf("%d",ch[n1]);

        printf(" ");

        n1+=1;

    }


    printf("%d\n",ch[n1]);





    while(n1>=0)

    {

        printf("%d",ch[n1]);

        n1--;

    }



    return 0;


}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区