#include void main(void){ int l = 0 , m = 0 , n = 0 ; int input = scanf("%d",&l); if(input == 2){ printf("Lの入力ミス\n"); } int total = 100*l; input = scanf("%d",&m); if(input == 2){ printf("Mの入力ミス\n"); } total += m*25; input = scanf("%d",&n); if(input == 2){ printf("Nの入力ミス\n"); } total += 1*n; int thousandYenBill = total / 1000; int remainingMoney = total - thousandYenBill; int coinL = 0; int coin = 0; while( remainingMoney >= 100 ){ remainingMoney -= 100; coin++; coinL++; } int coinM = 0; while( remainingMoney >= 25 ){ remainingMoney -= 25; coin++; coinM++; } printf("1000円札:%d 100円硬貨:%d 25円硬貨:%d 1円硬貨:%d\n",thousandYenBill,coinL,coinM,remainingMoney); printf("%d\n",coin+remainingMoney); }