You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
548 B

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
int wei;
cin>>wei;
if(wei<=10){
cout<<setiosflags(ios::fixed)
<<setprecision(2)
<<0.8*wei+0.2
<<endl;
}
else if(wei>10 && wei<=20){
cout<<setiosflags(ios::fixed)
<<setprecision(2)
<<8+0.75*(wei-10)+0.2
<<endl;
}
else if(wei>20 && wei<=30){
cout<<setiosflags(ios::fixed)
<<setprecision(2)
<<8+7.5+0.7*(wei-20)+0.2
<<endl;
}
else{
cout<<"ÎÞ·¨ÓʼÄ"<<endl;
}
return 0;
}