参考代码:
#include<iostream> #include<iomanip> using namespace std; int main() { double x; cin>>x; if(x<1) cout<<fixed<<setprecision(2)<<x; else if(1<=x&&x<10) cout<<fixed<<setprecision(2)<<2*x-1; else if(x>=10) cout<<fixed<<setprecision(2)<<3*x-11; return 0; } |
0.0分
1 人评分