14 条题解

  • 2
    @ 2023-8-31 17:11:21
    代码
    你被骗了!!!
    #include <iostreem>
    using namespace std;
    int main()
    {
        int j=0,t=0,y;
        y=50*4;
        j=(y-160)/2;
        t=50-j;。
        cout << j << ' ' << t;
        return 0;
    }
    

    记得点赞哦! —作者

    陷阱!这下是对的了!
    #include <iostream>
    using namespace std;
    int main()
    {
        int j=0,t=0,y;//y是计算兔子多出来的腿数,t是兔子数,j是鸡数。
        y=50*4;//兔子有四条腿。
        j=(y-160)/2;//鸡比兔子少两条腿,多出来的腿是鸡的。
        t=50-j;//由于刚开始假设50都是只兔子,所以兔子需要重新算。
        cout << j << ' ' << t;//打印出来。
        return 0;
    }
    

    记得点赞哦! —作者 😄

    • 0
      @ 2023-8-23 12:45:57

      鸡兔同笼问题:一个笼子里面有鸡若干只,兔若干只。共有头50个,共有腿160条。求鸡兔各多少只?

      这是一道简单应用题,步骤:

      假设全是兔(兔有四条腿,鸡有两条腿)

      50*4-160=40(条)

      鸡:40/(4-2)= 20(只)

      兔:50-20=30(只)

      然后输出就行了。

      #include<iostream>
      using namespace std;
      int main()
      {
          cout << 20<<" "<<30 ;
          return 0;
      }
      
      • -1
        @ 2024-4-22 20:08:50

        强悍假设法

        #include <iostream>
        using namespace std;
        int main()
        {
            cout << (50*4-160)/(4-2) << " " << 50-(50*4-160)/(4-2);
            return 0;
        }
        
        • -1
          @ 2024-3-25 20:20:23

          嘿嘿嘿……又来坑萌新了(bushi)先点赞再看!!养成好习惯

          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
              for(int i=1;i<=80;i++)
              {
                  for(int j=1;j<=40;j++)
                  {
                      if(i*2+j*4==160&&i+j==50)
                      {
                          cout<<i<<" "<<j;
                      }
                  }
              }
              return 0;
          }
          点赞!!!
          
          • -1
            @ 2023-7-30 20:06:25

            这才是真正的题解(已AC)

            #include  <iostream>
            using namespace std;
            int main()
            {
            cout<<20<<" "<<30;
            return 0;
            }
            
            • -1
              @ 2023-3-26 17:04:37

              假设法缩成一条

              #include<bits/stdc++.h>
              using namespace std;
              int main()
              {
                  cout<<(50*4-160)/2<<" "<<50-(50*4-160)/2;
                  return 0;
              }
              
              • -1
                @ 2022-12-6 14:36:29
                #include <iostream>//hetao3097453
                using namespace std;
                int main()
                {
                    int b = 4 * 50;
                    int c = b - 160;
                    int d = c / 2;
                    cout << d << " " << 50 - d;
                    return 0;
                }
                
                
                • -1
                  @ 2022-8-15 19:52:23

                  假设法 假设全部是兔子,则有50×4=200条腿,比实际多200-160=40只,一只兔子变成一只鸡腿减少2条,40/2=20只,所以需要20只鸡20兔子变成鸡,即鸡为20只,兔子为50-20=30只。

                  #include <iostream>
                  #include <cstdio>
                  using namespace std;
                  int main()
                  {
                      int a=(50*4-160)/2;//鸡的数量,假设法
                      cout<<a<<" "<<(50-a);
                      return 0;
                  }
                  
                  • -2
                    @ 2023-10-4 23:28:01
                    #include<bits/stdc++.h>
                    using namespace std;
                    int main()
                    {
                        for(int i=1;i<=80;i++)
                        {
                            for(int j=1;j<=40;j++)
                            {
                                if(i*2+j*4==160&&i+j==50)
                                {
                                    cout<<i<<" "<<j;
                                }
                            }
                        }
                        return 0;
                    }
                    
                    • -2
                      @ 2023-7-26 21:04:07

                      鸡:(50*4-160)/(4-2)=20(只) 兔:50-20=30(只)

                      • @ 2023-7-26 21:06:24
                        #include <bits/stdc++.h>
                        using namespace std;
                        int main()
                        {
                            cout<<"20 30";
                            return 0;
                        }
                        
                    • -2
                      @ 2023-7-15 19:09:38

                      这分明就是小学数学题嘛

                      • -2
                        @ 2022-10-17 21:39:18

                        枚举法

                        for i in range(50):  #总数有50只
                            a = i            #鸡的只数
                            b = 50-i         #兔的只数
                            if a*2+b*4 == 160:#腿的数量相加看是否等于要求
                                print('结果')
                        
                        • -2
                          @ 2022-5-26 22:04:41

                          #include <bits/stdc++.h>

                          using namespace std;

                          int main()

                          {

                          int a,b,c,x,y,z,m,sum=1,w2=0;
                          
                          a=160;
                          
                          b=50;
                          
                          x=(a-b*2)/2;
                          
                          y=b-x;
                          
                          cout<<y<<" "<<x;
                          
                          return 0;
                          

                          }

                          • -3
                            @ 2024-1-28 13:16:57

                            多么简单

                            #include <iostream>
                            using namespace std;
                            int main()
                            {
                                cout << 20 << " " << 30;
                                return 0;
                            }
                            
                            • 1

                            信息

                            ID
                            7
                            时间
                            1000ms
                            内存
                            16MiB
                            难度
                            3
                            标签
                            递交数
                            426
                            已通过
                            236
                            上传者