Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
38534 | 奚晨瑞 | 分段函数 | C++ | Accepted | 0 MS | 252 KB | 282 | 2024-01-27 16:21:07 |
#include<iostream> using namespace std; int main() { float N; cin>>N; if(0<=N&&N<5){ float a=2.5-N; printf("%.3f",a); } else if(5<=N&&N<10){ float a=2-1.5*(N-3)*(N-3); printf("%.3f",a); } else{ float a=N/2-1.5; printf("%.3f",a); } return 0; }