1 #include<stdio.h> 2 int main() 3 { 4 int n,s,x,t; 5 while(~scanf("%d",&n)&&n) 6 { 7 for(s=0; n; --n,s+=t) 8 { 9 scanf("%d",&x); 10 t=x/100+x%100/50+x%50/10+x%10/5+x%5/2+x%5%2;//注意最后一项即可 11 } 12 printf("%d\n",s); 13 } 14 return 0; 15 }