c++第4回実験

644 ワード

       
#include <iostream>     
using namespace std;    
int main()    
{    
    double a,b,c;    
    int count=0;  
    cout<<"      :"<<endl;    
    for(a=0;a<=20;a++)    
        for(b=0;b<=33;b++)    
            for(c=0;c<=300;c++)   
                if(a+b+c==100 && 5*a+3*b+c/3==100)        
                {  
                    ++count;  
                    cout<<count<<"、  :"<<a<<" ,  :"<<b<<" ,  :"<<c<<" 。"<<endl;   
                }  
    return 0;    
}