文章

133

粉丝

17

获赞

440

访问

23.9k

头像
百鸡问题 题解:
P1348 哈尔滨工业大学机试
发布于2026年3月17日 23:54
阅读数 322

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
int main() {
    double n;
    while (cin >> n) {
        for (double x = 0;x <= 100;x++) {
            for (double y = 0;y <= 100;y++) {
                for (double z = 100;z >= 0;z--) {
                    if (x + y + z != 100) {
                        continue;
                    }
                    if (n >= (z * 1.0 / 3 + y * 3 + 5 * x)) {
                        cout << "x=" << x << ",y=" <<...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发