社区讨论
52,求救!!!!!
B2047分段函数参与者 3已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @m5j6hdpf
- 此快照首次捕获于
- 2025/01/05 13:34 去年
- 此快照最后确认于
- 2025/11/04 11:57 4 个月前
CPP
#include<bits/stdc++.h>
using namespace std;
double x;
int main(){
cin>>x;
if (0<x&&x<5) {
cout<<fixed<<setprecision(3)<<-x+2.5;
}
else if (5<x&&x<10) {
cout<<fixed<<setprecision(3)<<2-1.5*(x-3)*(x-3);
}
else if (10<x&&x<20) {
cout<<fixed<<setprecision(3)<<x/2-1.5;
}
return 0;
}
回复
共 2 条回复,欢迎继续交流。
正在加载回复...