68分求助
查看原帖
68分求助
407994
_dhrxx_楼主2023/4/9 12:19
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<algorithm>
#define ll long long
#define ull unsigned long long
using namespace std;
int main()
{
	double x;
	cin>>x;
	double y;
	if(x<5) y=-x+2.5;
	if(x>5&&x<10) y=2-1.5*(x-3)*(x-3);
	if(x>10&&x<20) y=x/2-1.5;
	printf("%0.3f",y);
	return 0;
}
2023/4/9 12:19
加载中...