麻烦大佬帮忙看看错哪了
查看原帖
麻烦大佬帮忙看看错哪了
809296
zhan0518楼主2024/3/2 08:01
#include<bits/stdc++.h> 
using namespace std;

int main()
{
	int d;
	cin >> d;
	double cnt = 0;
	int c = d;
	if(d <= 150)
	{
		cout << setprecision(1) << d * 0.4463 << fixed;
		return 0;
	} 
	else if(d >=151 && d <= 400)
	{
		c -= 150;
		cout << setprecision(1) << fixed << c * 0.4663 + 150 * 0.4463;
		return 0;
	}
	else
	{
		d -= 400; 
		cout << setprecision(1) << fixed << d * 0.5663 + 150 * 0.4463 + 250 * 0.5663;
		return 0;
	}
}
2024/3/2 08:01
加载中...