PAT (Basic Level) Practice (中文)1023 组个最小数
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include<stdio.h> 2 #include<algorithm> 3 #include<string.h> 4 using namespace std; 5 const int maxn = 50; 6 int main(){ 7 int a[10],count=0,value; 8 for(int i=0;i<10;i++){ 9 scanf("%d",&value); 10 a[i] = value; 11 if(count==0&&value>0&&i!=0) {count = i;a[count]--;} 12 } 13 printf("%d",count); 14 for(int i=0;i<10;i++){ 15 if(a[i]>0) 16 for(int j=0;j<a[i];j++) 17 printf("%d",i); 18 } 19 }