标签:nbsp clu rom dex its scan seq can array
#include<cstdio>
int main()
{
int count[10];
for(int i=0;i<10;i++)
{
scanf("%d",&count[i]);//input ten digits map number 0~9
}
for(int i=1;i<10;i++)
{
if(count[i]>0)
{
printf("%d",i);//coz the array index is number 0~9,and the first cant be zero,so for begin with 1
count[i]--;
break;
}
}
for(int i=0;i<10;i++)
{
for(int j=0;j<count[i];j++)//and subsequent,output the numbers from small to big
printf("%d",i);
}
return 0;
}
标签:nbsp clu rom dex its scan seq can array
原文地址:http://www.cnblogs.com/dusanlang/p/7637648.html