描述 | |
---|---|
知识点 | 循环,查找 |
运行时间限制 | 10M |
内存限制 | 128 |
输入 | 输入任何一个整数,即可运行程序。 |
输出 |
|
样例输入 | 1 |
样例输出 | 0 25 75 4 18 78 8 11 81 12 4 84 |
#include <iostream>
#include <vector>
#include <stack>
#include <string>
using namespace std;
int main()
{
int A, B, C;
int other = 100;
int maxa = other / 5;
int maxb = other / 3;
int time = 0;
for (A = 0; A <= maxa; A++)
{
other = 100 - (5 * A);
maxb = other / 3;
for (B = 0; B <= maxb; B++)
{
C = 3 * (other - (3 * B));
if (100 == (A + B + C))
{
time++;
if (time)
cout <<' ';
cout<<A<<' '<<B<<' '<<C;
}
}
}
return 0;
}