#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
int x, y, z;
#ifndef ONLINE_JUDGE
ifstream cin("d:\\OJ\\uva_in.txt");
#endif
while (cin >> n) {
for (x = 0; x < n / 5 + 1; x++) {
for (y = 0; y < n / 3 + 1; y++) {
z = 100 - x - y;
if (z >= 0) {
if (5 * x + 3 * y + (z + 2) / 3 <= n) {
cout << "x=" << x << ",y=" << y << ",z=" << z << endl;
}
}
}
}
}
return 0;
}
题目1045:百鸡问题
最新推荐文章于 2025-05-24 14:00:00 发布