您的位置:首页 > 编程语言 > C语言/C++

C++ 马克思手稿问题(暴力循环)

2016-05-27 23:41 183 查看
#include <iostream>
using namespace std;
#include <iomanip>

#include<stdio.h>

int main()

{

int x,y,z;

for (x = 1; x<= 10; x++)

for (y =1 ; y <= 20; y++)
for (z = 1; z <= 20; z++)
if (         3*x+2*y+z==50&&x+y+z==30  )/*判断结果*/

cout << "男    女      少" << x<<"     "<<y<<"     "<<z<< endl;

system("pause");

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: