网站域名转出做一个网站要多少钱
pta L1-003 个位数统计
卡点
1000位超长数字求每一位为0-9的哪个数字
输出每个出现次数不为0 的数字及次数
用字符串!!!
别再用比大小了!
‘9’-‘0’=9
#include<stdio.h>
#include<string.h>int main()
{char array[1010]={0};int count[11]={0};gets(array);for(int i=0;array[i]!='\0';i++){count[array[i]-'0']++;}for(int i=0;i<10;i++)//i从0到9{if(count[i]!=0){printf("%d:%d\n",i,count[i]);}}return 0;
}