“21天养成好习惯”第一期-20
作者:互联网
这是pta上的一题
# include<stdio.h>
int main(void)
{
int salary_h=0;
unsigned int year=0;
unsigned int hours=0;
float salary=0;
scanf("%u %u",&year,&hours);
if(year<5)
{
salary_h=30;
}
else {salary_h=50;
}
if(hours<=40)
{
salary=salary_h*hours;
}
else
{
salary=1.5*salary_h*(hours-40) + salary_h*40;
}
printf("%.2f",salary);
return 0;
}
标签:salary,hours,20,21,int,unsigned,40,第一期,year 来源: https://blog.csdn.net/m0_63190565/article/details/121278808