Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1025 | 黄天泽 | 11计算分段函数的值 | C++ | Wrong Answer | 0 MS | 264 KB | 267 | 2023-06-24 14:29:34 |
#include<bits/stdc++.h> using namespace std; int main(){ int x; cin>>x; if (x<5&&x>=0){ cout<<fixed<<setprecision(3)<<-x+2.5; }else if(x<=5&&x<10){ cout<<fixed<<setprecision(3)<<2-1.5*(x-3)*2; }else{ cout<<fixed<<setprecision(3)<<x/2-1.5; } }
------Input------
12.8
------Answer-----
4.900
------Your output-----
4.500