<p align="left">opyright (c) 2016,
All rights reserced.
文件名称:main.cpp
作者 :李鑫
完成日期:2016.3.17</p>问题描述;
#include <iostream>
using namespace std;
int main()
{
int x,y;
double z;
for(y=0;y<=33;y++)
{
for(x=0;x<=20;x++)
{
for(z=0;z<=300;z++)
{
if(x+y+z==100&&5*x+3*y+z/3==100)
cout <<x<<" "<<y<<" "<<z<< endl;
}
}
}
return 0;
}
运行结果
<img src="https://img-blog.csdn.net/20160317083322129" alt="" />
知识点总结:从这个程序中,进一步巩固了对简单程序结构的认识,也学会了利用输入的结果的方法。