编译有错误,但不影响运行,题也过了,求助!
查看原帖
编译有错误,但不影响运行,题也过了,求助!
757057
bj12z_donglinxi楼主2023/1/14 10:10
#include <iostream>
#include <iomanip>
using namespace std;

double n;

double dian (double x) {
	if (x <= 150) {
		return x * 0.4463;
	} else if (x > 150 && x <= 400) {
		return 150 * 0.4463 + (x - 150) * 0.4663;
	} else if (x > 400) {
		return 150 * 0.4463 + 250 * 0.4663 + (x - 400) * 0.5663;
	}
}

int main() {
	cin >> n;
	cout << fixed << setprecision(1) << dian (n);
	return 0;
}
2023/1/14 10:10
加载中...