穷举法解决组合问题1
2016-08-25 22:53
120 查看
/*
*Copyright (c) 2016,烟台大学计算机学院
*All rights reserved.
*文件名称:text.cpp
*作者:汤善晔
*完成日期:2016年8月25日
*版本号:v1.0
*/
#include <iostream>
using namespace std;
int main()
{
int x,y,z;
for(x=1;x<20;x++)
{
for(y=1;y<33;y++)
{
for(z=3;z<100;z+=3)
if((x+y+z)==100&& ((x*5+y*3+z/3)==100) && ((x>=1)&&(y>=1)&&(z>=1) ))
{
cout <<x,y,z;
cout<<"\n";
}
}
}
return 0;
}
*Copyright (c) 2016,烟台大学计算机学院
*All rights reserved.
*文件名称:text.cpp
*作者:汤善晔
*完成日期:2016年8月25日
*版本号:v1.0
*/
#include <iostream>
using namespace std;
int main()
{
int x,y,z;
for(x=1;x<20;x++)
{
for(y=1;y<33;y++)
{
for(z=3;z<100;z+=3)
if((x+y+z)==100&& ((x*5+y*3+z/3)==100) && ((x>=1)&&(y>=1)&&(z>=1) ))
{
cout <<x,y,z;
cout<<"\n";
}
}
}
return 0;
}
相关文章推荐
- 第9周项目6-穷举法解决组合问题之百钱百鸡问题
- 第9周项目6-穷举法解决组合问题之委派任务
- 第十一周项目2 穷举法解决组合问题
- 第9周项目6-穷举法解决组合问题(3,4)
- 第九周项目六穷举法解决组合问题(3)三色球问题
- 第9周项目6穷举法解决组合问题
- 第9周项目6-穷举法解决组合问题之换分币
- 第九周项目六穷举法解决组合问题(1)百钱百鸡问题
- 第十一周——项目2:穷举法解决组合问题(1)百钱买百鸡
- 第9周上机实践项目6——穷举法解决组合问题(1~3)
- 利用穷举法解决组合问题,背包问题,变量相等问题
- 项目六 穷举法解决组合问题(2)换分币
- 第9周项目6-穷举法解决组合问题之年龄几何
- 穷举法解决组合问题
- 第9周项目6-穷举法解决组合问题之三色球问题
- 第九周 项目六穷举法解决组合问题之换分币
- 项目六 穷举法解决组合问题 (1)百钱百鸡问题
- 第9周项目6穷举法解决组合问题(1)
- 第九周项目六穷举法解决组合问题(3)年龄几何
- 穷举法解决组合问题