依次统计每张面值的张数即可
# include <stdio.h>
int main(){
int i,n,a[200];
while(~scanf("%d",&n)){
int sum=0;
if(n==0)
continue;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
int q=0,w=0,e=0,r=0,t=0,y=0;
if(a[i]>=100){
q = a[i]/100;
a[i] -= 100*q;
}
if(a[i]>=50&&a[i]<100){
w = a[i]/50;
a[i] -=50;
}
if(a[i]>=10&&a[i]<50){
e = a[i]/10;
a[i] -= e*10;
}
if(a[i]>=5&&a[i]<10){
r = 1;
a[i] -= 5;
}
if(a[i]>=2&&a[i]<5){
t = a[i]/2;
a[i] -=2*t;
}
if(a[i]==1)
y = 1;
sum+=q+w+e+r+t+y;
}
printf("%d\n",sum);
}
}