提交时间:2024-09-20 19:25:53

运行 ID: 51301

#include<bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if(0 <= x < 5){ cout<<-x+2.5; }if(5 <= x < 10){ cout<<2-1.5*(x-3)*(x-3); }if(10 <= x < 20){ cout<<x/2-1.5; } return 0; }