计费问题c程序

游客通过提示输入预付的钱数 ,游玩的时间 和每小时的单价就会输出找零或者需要补交的钱数

#include
int main (void)
{
int money;//预付定钱数 
int h;//游玩的时间 
int price;//单价 
printf("please input how much\n ");
    scanf("%d",&money);
printf("please input time\n");
scanf("%d",&h);
printf("please input price\n");
scanf("%d",&price);
if  (h != (int)h)
{
h = (int)h + 1;
}
else if (( money-h*price)> 0)
{
printf("return you %d¥\n", money-h*price );
}
if  ((money-h*price)<0) 
{
printf("you should give this much money %d¥\n",-( money-h*price));
}
}

你可能感兴趣的:(c程序,c基础,c语言,c)