Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
1921 孙浚轩 11计算分段函数的值 C++ Wrong Answer 0 MS 264 KB 399 2023-12-02 16:43:14

Tests(0/10):


Code:

#include<iostream> #include<iomanip> using namespace std; int main() { double x,y,z; cin>>x; if(x>=0&&x<=20){ if(x<5){ x=-x+2.5; } else if(x>=5&&x<10){ x=(2-1.5*(x-3)*2)+-5+2.5; } else{ x=(x/2-1.5)+(2-1.5*(10-3)*2)+-5+2.5; } } cout<<fixed<<setprecision(3)<<x; return 0; }


Run Info:

------Input------
12.8
------Answer-----
4.900
------Your output-----
-16.600