4 条题解

  • 2
    @ 2023-11-12 8:43:16

    ACAC CodeCode

    #include <bits/stdc++.h>
    using namespace std;
    int a[10];
    int main()
    {
        bool flag = 1;
        for (int i = 1; i <= 8; i++)
            cin >> a[i];
        for (int i = 1; i <= 7; i++)
        {
            if (a[i] > a[i + 1])
            {
                flag = false;
            }
        }
        if (flag)
        {
            cout << "ascending" << endl;
            return 0;
        }
        else
        {
            bool ma = 1;
            for (int i = 1; i <= 7; i++)
            {
                if (a[i] < a[i + 1])
                {
                    ma = false;
                }
            }
            if (ma)
            {
                cout << "descending" << endl;
                return 0;
            }
        }
        cout << "mixed" << endl;
        return 0;
    }
    
    • 0
      @ 2023-12-9 20:41:23
      #include<iostream>
      int main()
      {
          int s=0,a;
          for(int i=1;i<=8;i++)
          {
              std::cin>>a;
              s=s*10+a;
          }
          if(s==12345678)puts("ascending");
          else if(s==87654321)puts("descending");
          else puts("mixed");
      }
      
      • 0
        @ 2023-12-9 15:07:34

        AC code::

        #include<iostream>
        #include<algorithm>
         
        using namespace std;
         
        int a[10];
        int flag;
         
        int main()
        {
        	for(int i=1;i<=8;i++)
        		cin>>a[i];
        	if(a[1]==1 && a[2]==2 && a[3]==3 && a[4]==4 && a[5]==5 && a[6]==6 && a[7]==7 && a[8]==8)
        		cout<<"ascending";
        	else if(a[1]==8 && a[2]==7 && a[3]==6 && a[4]==5 && a[5]==4 && a[6]==3 && a[7]==2 && a[8]==1)
        		cout<<"descending";
        	else
        		cout<<"mixed";
        	
        	return 0; 
        }
        
        • 0
          @ 2023-11-8 20:39:31

          屎上最简单的题目

          #include <iostream>
          using namespace std;
          int main(){
              string a; getline(cin,a);
              if(a=="1 2 3 4 5 6 7 8")cout<<"ascending";
              else if(a=="8 7 6 5 4 3 2 1")cout<<"descending";
              else cout<<"mixed";
              return 0;}
          
          • 1

          信息

          ID
          540
          时间
          1000ms
          内存
          32MiB
          难度
          5
          标签
          递交数
          375
          已通过
          136
          上传者