| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 119932 | 罗睿妍 | 11计算分段函数的值 | C++ | Wrong Answer | 1 MS | 268 KB | 303 | 2025-05-21 21:31:53 |
#include <iostream> using namespace std; int main() { double x,y; cin>>x; if(x>=0&&x<5) y=x+2.5; else if(x<10) y=2-1.5*(x-3)*(x-3); else if (x<20) y=x*x-1.5; else y=0; y=(int)(y*1000+0.5)/1000.0; cout<<y; return 0; }
------Input------
17.6
------Answer-----
7.300
------Your output-----
308.26