68求助
查看原帖
68求助
1045213
Tairitsu_Cat楼主2023/8/17 20:14
#include<bits/stdc++.h>
using namespace std;
double x,y;
int main(){
	cin>>x;
	if(0<=x&&x<5) y=-x+2.5;
	if(5<=x&&x<10) 2-1.5*(x- 3)*(x - 3);
	if(10<=x&&x<20) y=x/2-1.5;
	printf("%.3lf",y);
	return 0;
}

2023/8/17 20:14
加载中...