本帖最后由 louyuxiang 于 2024-6-15 09:00 编辑
[C++] 纯文本查看 复制代码 #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main(){
float n,t,m;
cin>>n>>t;
if(n>5 && t<=40){
m=30*t;
}if(n>5 && t>40){
m=(t-40)*1.6+30*t;
}if(n<=5 && t<=40){
m=50*t;
}if(n<=5 && t>40){
m=(t-40)*1.6+50*t;
}
cout<<fixed<<setprecision(2)<<m<<endl;
} |