84分求助
查看原帖
84分求助
957438
Chen20090918楼主2023/7/17 15:06

不知道哪错了

#include<bits/stdc++.h>
using namespace std;
int main()
{
	double x,b;
	cin>>x;
	if(x>=0&&x<5)b=-1.0*x+2.5;
	else if(x>5&&x<10)b=2.0-1.5*(x-3.0)*(x-3.0);
	else if(x>=10&&x<20)b=x/2.0-1.5;
	printf("%.3lf",b);
	return 0;
}
2023/7/17 15:06
加载中...