HDU/2021/main.c

22 lines
443 B
C
Raw Permalink Normal View History

2020-08-31 16:48:58 +00:00
#include <stdio.h>
int rmb[6] = {100, 50, 10, 5, 2, 1};
int main(void){
int numbers = 0,ac[100];
while(scanf("%d",&numbers) == 1){
if(!numbers) continue;
int temp, i, all = 0, count;
for(i = 0; i < numbers; i++) scanf("%d",&ac[i]);
for(i = 0; i < numbers; i++){
temp = ac[i];
for(count = 0; count < 6; count++){
all += temp / rmb[count];
temp %= rmb[count];
}
}
printf("%d\n",all);
getchar();
}
return 0;
}