求助!样例过了但全WA
查看原帖
求助!样例过了但全WA
1098005
love_lz2023楼主2024/6/11 15:43

码风不好,请大佬见谅

#include "bits/stdc++.h"
using std::cin;
using std::cout;
long double a, b, c, d;
long double n;

int main(void) {
	cin >> a;
	for (int i = 1; i <= a; i++) {
		cin >> b >> c >> d;
		if (b > c) {
			n = b / c;
			n = n * d + d;
			cout << n << "\n";
			continue;
		} else {
			n = c / b;
			n = n * d + d;
			cout << n << "\n";
			continue;
		}
	}
	return 0;
}

2024/6/11 15:43
加载中...