Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
37838 yuanhaoxiang 分段函数 C++ 通过 0 MS 260 KB 274 2024-01-23 15:09:10

Tests(1/1):


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


测评信息: