解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:563 |
C二级辅导-统计字符 (C语言代码)浏览:729 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:1052 |
简单编码 (C++代码)浏览:675 |
C语言训练-字符串正反连接 (C语言代码)浏览:618 |
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:859 |
输出正反三角形 (C语言代码)格式错误!!!浏览:1140 |
简单的a+b (C语言代码)浏览:524 |
C语言训练-阶乘和数* (C语言代码)-------- 呆板写法浏览:1345 |
C语言程序设计教程(第三版)课后习题9.10 (C语言代码)浏览:548 |