3 1 2 3 0
4
#include<stdio.h> int main() { int i,j,n,t,k,s[6]={100,50,10,5,2,1}; while(~scanf("%d",&n),n) { for(i=j=k=0;i<n;i++,j=0) { scanf("%d",&t); while(t) { if(t<s[j]) j++; else t-=s[j],k++; } } printf("%d\n",k); } return 0; }
原文:http://blog.csdn.net/darwin_/article/details/18925933