C++百钱白鸡问题

来源:互联网 发布:windows store是什么 编辑:程序博客网 时间:2024/05/22 14:58
问题描述:百钱白鸡

#include<iostream>  
using namespace std;  
int main( )  
{  
      
    int x,y,z;  
    for(x=0;x<20;x++)  
        for(y=0;y<33;y++)  
        {  
            z=100-x-y;  
  
            if(5*x+3*y+z/3==100)  
                cout<<x<<","<<y<<","<<z<<endl;  
        }  
      
}  
0 0