3 条题解

  • 5
    @ 2023-10-11 12:55:52

    先赞后搬

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        for(int i=0;i<=16;i++)
        {
            for(int j=0;j<=25;j++)
            {
                for(int w=0;w<=50;w++)
                {
                    if(i*3+j*2+w==50&&i+j+w==30)
                    {
                        cout<<i<<" "<<j<<" "<<w<<endl;
                    }
    
                }
            }
        }
        return 0;
    }
    
    • 0
      @ 2023-10-6 21:56:44
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          cout << "0" << " " << "20" << " " << "10" << endl; 
          cout << "1" << " " << "18" << " " << "11" << endl; 
          cout << "2" << " " << "16" << " " << "12" << endl; 
          cout << "3" << " " << "14" << " " << "13" << endl; 
          cout << "4" << " " << "12" << " " << "14" << endl; 
          cout << "5" << " " << "10" << " " << "15" << endl; 
          cout << "6" << " " << "8" << " " << "16" << endl; 
          cout << "7" << " " << "6" << " " << "17" << endl; 
          cout << "8" << " " << "4" << " " << "18" << endl; 
          cout << "9" << " " << "2" << " " << "19" << endl;
          cout << "10" << " " << "0" << " " << "20" << endl;  
          return 0;
      }//A
      
      • 0
        @ 2023-1-17 22:11:26
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int i,j,x,y;
        	//循环男人可能的人数
        	for(i = 0; i <= 50 / 3; i++){
        		//剩余的钱
        		x = 50 - i * 3;
        		//循环女人可能的人数
        		for(j = 0; j <= x / 2; j++){
        			y = x - j * 2;
        			//剩余的y元,分配给小孩,要求总人数为30
        			if(i+j+y == 30){
        				cout << i << " " << j << " " << y << endl;
        			} 
        		} 
        	} 
        	return 0;
        }
        
        • 1

        【入门】马克思手稿的问题

        信息

        ID
        250
        时间
        1000ms
        内存
        16MiB
        难度
        2
        标签
        递交数
        76
        已通过
        46
        上传者