Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
77744 sh25_shengmy 分段函数 C++ Accepted 0 MS 256 KB 395 2025-12-26 14:44:31

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int main() { double a,b; cin >> a; if(a<5.0) { b=-a+2.5; cout << fixed << setprecision(3) <<b; } else if(a<10.0) { b=2.0-1.5*(a-3.0)*(a-3.0); cout << fixed << setprecision(3) << b; } else { b=a/2.0-1.5; cout << fixed << setprecision(3) << b; } return 0; }


Judgement Protocol: