1 #include2 int main()3 {4 int shu_zi=0,xun_huan=0,shu_zu[10]={0};5 printf("请输入一个数字:");6 scanf("%d",&shu_zi);7 do8 {9 shu_zu[shu_zi%10]++;10 shu_zi/=10;11 }while(shu_zi);12 for(xun_huan=0;xun_huan

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 04:07:16
1 #include2 int main()3 {4 int shu_zi=0,xun_huan=0,shu_zu[10]={0};5 printf(

1 #include2 int main()3 {4 int shu_zi=0,xun_huan=0,shu_zu[10]={0};5 printf("请输入一个数字:");6 scanf("%d",&shu_zi);7 do8 {9 shu_zu[shu_zi%10]++;10 shu_zi/=10;11 }while(shu_zi);12 for(xun_huan=0;xun_huan
1 #include
2 int main()
3 {
4 int shu_zi=0,xun_huan=0,shu_zu[10]={0};
5 printf("请输入一个数字:");
6 scanf("%d",&shu_zi);
7 do
8 {
9 shu_zu[shu_zi%10]++;
10 shu_zi/=10;
11 }while(shu_zi);
12 for(xun_huan=0;xun_huan

1 #include2 int main()3 {4 int shu_zi=0,xun_huan=0,shu_zu[10]={0};5 printf("请输入一个数字:");6 scanf("%d",&shu_zi);7 do8 {9 shu_zu[shu_zi%10]++;10 shu_zi/=10;11 }while(shu_zi);12 for(xun_huan=0;xun_huan
shu_zi%10 //通过求余数,计算一个数的最低位是什么数字,会得到一个 0 9的数
例如 如果 shu_zi%10结果为 3,则 将 shu_zu数组的下标为 3 的 数字 自加 1 .
此程序用于分析一个十进制数,9 每个数字出现的次数.