解题思路:
注意事项:
参考代码:
#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 人评分
买不到的数目 (C++代码)浏览:868 |
本人酷爱递归实现很多问题,这里也是浏览:562 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:546 |
有关字符,字符串的输入输出函数说明浏览:480 |
简单的a+b (C语言代码)浏览:506 |
1415题求解浏览:636 |
【蟠桃记】 (C语言代码)浏览:631 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:652 |
汪汪与打针 (C++代码)浏览:1375 |
【出圈】 (C语言代码)浏览:618 |