アニメ!アニメ!

2021年7月11日日曜日

C言語練習問題5

 #include <stdio.h>


int main(void)

{

int money,potion,ether,sword,shield,payment,change;

double tax;

potion = 100;

ether = 1000;

sword = 1500;

shield = 500;

money = 10000;

tax = 1.10;

payment = (int)((potion + ether * 2) * tax);

change = money - payment;

printf("%dG\n",change);

return 0;

}