题目:http://acm.hdu.edu.cn/showproblem.php?pid=2021
代码:
#include<stdio.h> #include<stdlib.h> int r[6]={100,50,10,5,2,1}; int main(){ int n,i,j,temp; while(scanf("%d",&n)!=EOF){ if(n==0)break; int num[6]={0},cnt=0; for(i=0;i<n;i++){ scanf("%d",&temp); for(j=0;j<6;j++){ num[j]+=temp/r[j]; temp=temp%r[j]; } } for(i=0;i<6;i++){ cnt+=num[i]; } printf("%d/n",cnt); } }
posted on 2011-02-28 15:34 江南烟雨hust 阅读(232) 评论(0) 收藏 举报