第7 10 13报错,但我感觉没问题啊
查看原帖
第7 10 13报错,但我感觉没问题啊
1056927
caibi666楼主2023/9/2 10:24
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	int T;
	cin >> T;
	if (T == 1) {
		cout << "I love Luogu!";
	}
	else if (T ==2) {
		cout << 6 << " " << 4;
	}
	else if (T == 3) {
		cout << (14 / 4) << endl << (14 / 4 * 4) << endl << (14 % 4);
	}
	else if (T == 4) {
		cout << 500.0 / 3;
	}
	else if (T == 5) {
		cout << (260 + 220) / (12 + 20);
	}
	else if (T == 6) {
		cout << sqrt(pow(6, 2) + pow(9, 2));
	}
	else if (T == 7) {
		int balance = 100;
		balance += 10;
		cout << balance;
		balance -= 20;
		cout << balance;
		balance = 0;
		cout << balance;
	}
	else if (T == 8) {
		double r = 5; 
		#define PI 3.141593
		cout << 2 * PI * r << endl;
		cout << PI * r * r << endl;
		cout << 4.0 / 3 * PI * pow(r, 3) << endl;
	}
	else if (T == 9) {
		int ans = 1;
		ans = (ans + 1) * 2;
		ans = (ans + 1) * 2;
		ans = (ans + 1) * 2;
		cout << ans;
	}
	else if (T == 10) {
		int n1 = 8, t1 = 30, n2 = 10, t2 = 6;
		int t3 = 10;
		double v = (1.0 * n1 * t1 - n2 * t2) / (t1 = t2);
		double a = n2 * t2 - v * t2;
		double ans = (a + t3 * v) / t3;
		cout << ans;
	}
	else if (T == 11) {
		cout << 100.0 / (8 - 5);
	}
	else if (T == 12) {
		cout << 'M' - 'A' + 1 << endl;
		cout << char('A' + 18 - 1);
	}
	else if (T == 13) {
		int r1 = 4, r2 = 10;
		double v, l;
		v = 4.0 / 3 * PI * (r1 * r1 * r1 + r2 * r2 * r2);
		l = pow(v, 1.0 / 3);
	}
	else if (T == 14) {
		double a = 1, b = -100, c = 2400;
		double delta, ans;
		delta = pow(b, 2) - 4 * a * c;
		ans = (-b + sqrt(delta)) / (2 * a);
		cout << 110 - int(ans + 0.5) << endl;
	}
	return 0;
}
2023/9/2 10:24
加载中...