gpt4 book ai didi

c - 如何确定 C 调试错误中的每周工资;

转载 作者:太空宇宙 更新时间:2023-11-04 08:05:41 26 4
gpt4 key购买 nike

<分区>

我正在创建一个计算周薪的程序,其中加类费是周薪的 1.5。这是我的代码:

#include <stdio.h>

int main()
{

double payrate;
double hours;
double weeklypay = hours * payrate;
double overtimehours = hours - 40;
double overtimepay = weeklypay * 1.5;
double overtimesalary = weeklypay + (overtimehours * overtimepay);

printf("What is your standard hourly pay rate?\n");
scanf("%d",&payrate);
printf("How many hours do you work in a week?\n");
scanf("%d",&hours);

if (hours <= 40)
printf("This means your weekly pay is %d . \n", weeklypay);

else (hours > 40)
printf("This means your weekly pay is %d . \n", overtimesalary);


return 0;
}

我在运行我的程序时不断收到此错误,我完全不明白为什么?

 expected ‘;’ before ‘printf’

我意识到我在做一些愚蠢的事情;如果有人可以帮助我意识到我的错误,我将不胜感激。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com