#include <stdio.h>
int main(){
int year,hour;
double money;
if (scanf("%d %d",&year,&hour)!=EOF){
//printf("%d %d\n",year,hour);
// 分析不敲钟的时间
if (year<5){
if (hour<=40){money=hour*30.0;}
else{money=1200+(hour-40)*45.0;}
}else{
if (hour<=40){money=hour*50.0;}
else{money=2000+(hour-40)*75.0;}
}
printf("%.2f\n",money);
}
else{
printf("input wrong");
}
return 0;
}
代码来自:https://yunjinqi.top/article/234