>>826
#include <stdio.h>

int main(void){
int sum = 0, num, cnt, tmp;
int money[] = {10000, 5000, 1000, 500, 100, 50, 10, 5, 1};
printf("人数:");
scanf("%d", &num);
if(num <= 0){
printf("正しい人数を入力して下さい\n");
return -1;
}
for(cnt=0; cnt<num; cnt++){
printf("%d人目の交通費:", cnt+1);
scanf("%d", &tmp);
sum += tmp;
}
for(cnt=0; cnt<9; cnt++){
tmp = sum / money[cnt];
if(tmp != 0){
printf("%d円:%d枚\n", money[cnt], tmp);
sum -= tmp * money[cnt];
}
}
return 0;
}