1 solutions

  • 0
    @ 2025-11-5 19:37:17

    C :

    #include<stdio.h>
    int main()
    {
    	int T,b,a,s;
    	scanf("%d",&T);
    	while(T--)
        {
    	scanf("%d%d",&a,&b);
    			s=b+a;	
    		if(a>b&&s<=6)
    		printf("XDZ\n");
    	else if(a<b&&s<=6)
    		printf("YY\n");
    	else if(a>b&&s>6)
    		printf("YY\n");
    	else if(a<b&&s>6)
    		printf("XDZ\n");
    	else if(a==b)
    		printf("DOGFALL\n");
    	}
    	return 0;
    }
    

    C++ :

    #include<iostream>
    #include<cstdio>
    using namespace std;
    int main()
    {
        //freopen("5.txt","r",stdin);
        //freopen("6.txt","w",stdout);
        int T;
        cin>>T;
        while(T--)
        {
            int n,m;
            cin>>n >>m;
            if(n == m)
            cout<<"DOGFALL"<<endl;
            else
            {
                if(n + m <= 6)
                {
                    if(n > m)
                    cout<<"XDZ"<<endl;
                    else
                    cout<<"YY"<<endl;
                }
    
                else
                {
                    if(n < m)
                    cout<<"XDZ"<<endl;
                    else
                    cout<<"YY"<<endl;
                }
            }
    
        }
    }
    
    

    Python :

    # coding=utf-8
    p=int(input())
    for i in range(p):
        Z=input().split()
        XDZ=int(Z[0])
        YY=int(Z[1])
        
        if XDZ +YY<=6:
            if XDZ>YY:
                print('XDZ')
            if XDZ < YY:
                print('YY')
            if XDZ==YY:
                print('DOGFALL')
        else:
            if XDZ < YY:
                print('XDZ')
            if XDZ > YY:
                print('YY')
            if XDZ == YY:
                print('DOGFALL')
                
    
    
    • 1

    Information

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