<分区>
我正在创建一个计算周薪的程序,其中加类费是周薪的 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’
我意识到我在做一些愚蠢的事情;如果有人可以帮助我意识到我的错误,我将不胜感激。