1 solutions

  • 0
    @ 2025-11-5 16:51:56

    C :

    #include<stdio.h>
    int main()
    {
      int n,i=1,a,b;
      scanf("%d",&n);
      while(i<=n)
      {  
    	  i++;
    	  scanf("%d%d",&a,&b);
         if(a==b)
    		 printf("zi\n");
    	 else
    		 printf("cheng\n");
      }
    	 return 0;
    }
    
    

    C++ :

    #include<cstdio>
    #include<iostream>
    #include<cstring>
    using namespace std;
    
    int main()
    {
        int i,j,k;
        int t,n,m;
        int s;
        scanf("%d",&t);
        while(t--)
        {
            s=0;
            for(i=1; i<=2; i++)
            {
                scanf("%d",&m);
                s^=m;
            }
            if(s)
                printf("cheng\n");
            else
                printf("zi\n");
        }
        return 0;
    }
    
    
    • 1

    Information

    ID
    18018
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By