5 条题解

  • 3
    @ 2022-12-18 12:35:06
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a[3];
        double sum = 0, num = 0;
        for (int i = 0; i < 3; i++)
        {
            cin >> a[i];
            sum += a[i];
        }
        sum /= 3;
        if (sum >= 90)
        {
            for (int i = 0; i < 3; i++)
            {
                if (a[i] >= 90)
                {
                    num++;
                }
            }
            if (num == 3)
            {
                cout << "beijing" << endl;
            }
            else if (num == 2)
            {
                cout << "xiamen" << endl;
            }
            else if (num == 1)
            {
                cout << "guilin" << endl;
            }
        }
        else if (sum >=85)
        {
            if(a[0] >= 85 && a[1] >= 85 && a[2] >= 85)
            {
                cout << "shanghai" << endl;
            }
            else
            {
                cout << "nanjing" << endl;
            }
        }
        return 0;
    }
    
  • 2
    @ 2022-12-18 12:34:55
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a[3];
        double sum = 0, num = 0;
        for (int i = 0; i < 3; i++)
        {
            cin >> a[i];
            sum += a[i];
        }
        sum /= 3;
        if (sum >= 90)
        {
            for (int i = 0; i < 3; i++)
            {
                if (a[i] >= 90)
                {
                    num++;
                }
            }
            if (num == 3)
            {
                cout << "beijing" << endl;
            }
            else if (num == 2)
            {
                cout << "xiamen" << endl;
            }
            else if (num == 1)
            {
                cout << "guilin" << endl;
            }
        }
        else if (sum >=85)
        {
            if(a[0] >= 85 && a[1] >= 85 && a[2] >= 85)
            {
                cout << "shanghai" << endl;
            }
            else
            {
                cout << "nanjing" << endl;
            }
        }
        return 0;
    }
    
    • 2
      @ 2022-12-18 12:34:48
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a[3];
          double sum = 0, num = 0;
          for (int i = 0; i < 3; i++)
          {
              cin >> a[i];
              sum += a[i];
          }
          sum /= 3;
          if (sum >= 90)
          {
              for (int i = 0; i < 3; i++)
              {
                  if (a[i] >= 90)
                  {
                      num++;
                  }
              }
              if (num == 3)
              {
                  cout << "beijing" << endl;
              }
              else if (num == 2)
              {
                  cout << "xiamen" << endl;
              }
              else if (num == 1)
              {
                  cout << "guilin" << endl;
              }
          }
          else if (sum >=85)
          {
              if(a[0] >= 85 && a[1] >= 85 && a[2] >= 85)
              {
                  cout << "shanghai" << endl;
              }
              else
              {
                  cout << "nanjing" << endl;
              }
          }
          return 0;
      }
      
      • 2
        @ 2022-12-18 12:34:34
        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
            int a[3];
            double sum = 0, num = 0;
            for (int i = 0; i < 3; i++)
            {
                cin >> a[i];
                sum += a[i];
            }
            sum /= 3;
            if (sum >= 90)
            {
                for (int i = 0; i < 3; i++)
                {
                    if (a[i] >= 90)
                    {
                        num++;
                    }
                }
                if (num == 3)
                {
                    cout << "beijing" << endl;
                }
                else if (num == 2)
                {
                    cout << "xiamen" << endl;
                }
                else if (num == 1)
                {
                    cout << "guilin" << endl;
                }
            }
            else if (sum >=85)
            {
                if(a[0] >= 85 && a[1] >= 85 && a[2] >= 85)
                {
                    cout << "shanghai" << endl;
                }
                else
                {
                    cout << "nanjing" << endl;
                }
            }
            return 0;
        }
        
        • 0
          @ 2023-4-7 21:07:37
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
              int a[7],sum=0;
              for (int i=1;i<=3;i++)
              {
                  cin>>a[i];
                  if (a[i]>=90)
                      sum++;
              }
              if (a[1]+a[2]+a[3]>=270)
              {
                  if (sum==3)
                      cout<<"beijing";
                  else if (sum==2)
                      cout<<"xiamen";
                  else if (sum==1)
                      cout<<"guilin";
              }
              else if (a[1]+a[2]+a[3]>=255)
                  if (a[1]>=85&&a[2]>=85&&a[3]>=85)
                      cout<<"shanghai";
                  else
                      cout<<"nanjing";
              return 0;
          }
          • 1

          【入门】暑假的旅行计划3

          信息

          ID
          676
          时间
          1000ms
          内存
          128MiB
          难度
          5
          标签
          递交数
          131
          已通过
          46
          上传者