Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
129043 李馥甄 11计算分段函数的值 C++ Accepted 2 MS 268 KB 256 2025-08-21 16:17:51

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; float N; int main(){ scanf("%f",&N); if(N<5){ printf("%.3lf",-N+2.5); }else if(N>=5&&N<10){ printf("%.3lf",2-1.5*(N-3)*2); }else if(N>=10&&N<20){ printf("%.3lf",N/2-1.5); } return 0; }