#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int n;
while (cin>>n)
{
for (int x = 0; x <= 100; x++){
for (int y = 0; y <= 100-x; y++){
int z = 100 - x - y;
if (x * 5 * 3 + y * 3 * 3 + z <= n * 3){
cout << "x=" << x << "," << "y=" << y << "," << "z=" << z << endl;
}
}
}
}
}
C++版本百鸡问题1045
最新推荐文章于 2024-06-05 20:54:12 发布