5 solutions

  • 1
    @ 2025-7-7 11:25:29
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a;
        cin>>a;
        if(a%12==1)
        {
            cout<<"rooster";
        }
        if(a%12==2)
        {
            cout<<"dog";
        }
        if(a%12==3)
        {
            cout<<"pig";
        }
        if(a%12==4)
        {
            cout<<"rat";
        }
        if(a%12==5)
        {
            cout<<"ox";
        }
        if(a%12==6)
        {
            cout<<"tiger";
        }
        if(a%12==7)
        {
            cout<<"rabbit";
        }
        if(a%12==8)
        {
            cout<<"dragon";
        }
        if(a%12==9)
        {
            cout<<"snake";
        }
        if(a%12==10)
        {
            cout<<"horse";
        }
        if(a%12==11)
        {
            cout<<"sheep";
        }
        if(a%12==0)
        {
            cout<<"monkey";
        }
        return 0;
    }
    
    • 0
      @ 2025-7-7 11:25:11

      快发

      • 0
        @ 2025-7-7 11:25:07
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            int a;
            cin>>a;
            if(a%12==0) cout<<"monkey";
            else if(a%12==1) cout<<"rooster";
            else if(a%12==2) cout<<"dog";
            else if(a%12==3) cout<<"pig";
            else if(a%12==4) cout<<"rat";
            else if(a%12==5) cout<<"ox";
            else if(a%12==6) cout<<"tiger";
            else if(a%12==7) cout<<"rabbit";
            else if(a%12==8) cout<<"dragon";
            else if(a%12==9) cout<<"snake";
            else if(a%12==10) cout<<"horse";
            else cout<<"sheep";
            return 0;
        }
        
        • 0
          @ 2025-7-7 10:44:21

          6

          • -8
            @ 2024-3-23 9:36:33

            12个if

            • 1

            Information

            ID
            1279
            Time
            1000ms
            Memory
            256MiB
            Difficulty
            1
            Tags
            (None)
            # Submissions
            230
            Accepted
            70
            Uploaded By