求助求助555
查看原帖
求助求助555
1033719
GAOXINGYI0703楼主2024/10/7 16:44
#include <bits/stdc++.h>
using namespace std;
double x,y;
int main() {
	cin>>x;
	if(x>=0&&x<5) {
		y=(-1*x)+2.5;
		printf("%.3f",&y);
	}
	if(x>=5&&x<10) {
		y=(2-1.5)*(x-3)*(x-3);
		printf("%.3f",&y);
	}
	if(x>=10&&x<20) {
		y=(x/2)-1.5;
		printf("%.3f",&y);
	}

	return 0;
}
2024/10/7 16:44
加载中...