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

          快发

          • -2
            @ 2025-7-7 10:44:21

            6

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

              12个if

              • 1

              Information

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