HDU/2021/main.c
Saturneric 0525ffad24 Add.
2020-09-01 00:48:58 +08:00

22 lines
443 B
C

#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;
}