Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
149988 黄俊仪 11计算分段函数的值 C++ Accepted 1 MS 272 KB 308 2026-03-21 15:51:14

Tests(10/10):


Code:

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