解题思路:
注意事项:
参考代码:
#include <stdio.h>
#include<math.h>
int A(int a);
void B(int a,int count);
void C(int a,int count);
int main()
{
int a=0,b,count;
scanf("%d",&a);
count=A(a);
B(a,count);
C(a,count);
return 0;
}
int A(int a)
{
int count=0;
while(a!=0)
{
a=a/10;
count++;
}
printf("%d\n",count);
return count;
}
void B(int a,int count)
{
int b;
while(a!=0)
{
b=a/(int)(pow(10,--count));
printf("%d",b);
a=a%((int)pow(10,count));
if(count==0)
{
break;
}
printf(" ");
}
printf("\n");
}
void C(int a,int count)
{
int b;
while(a!=0)
{
b = a % 10;
printf("%d", b);
a = a / 10;
}
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:692 |
WU-蓝桥杯算法提高VIP-交换Easy (C++代码)浏览:1118 |
最小公倍数 (C语言代码)浏览:1029 |
C语言训练-数字母 (C语言代码)浏览:608 |
幸运数 (C++代码)浏览:1264 |
1642题解浏览:715 |
字符逆序 (C语言代码)浏览:460 |
printf基础练习2 (C语言代码)浏览:503 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:535 |
Tom数 (C语言代码)浏览:555 |