1 solutions

  • 0
    @ 2025-12-3 16:38:14

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int g,x,y;
    string a,b;
    int main()
    {
    	cin>>g;
    	while(g--)
    	{
    		cin>>a>>x>>b>>y;
    		int as=a.size(),bs=b.size();
    		if(as+x==bs+y)
    		{
    			if(as>bs) 
    				for(int i=0;i<as-bs;i++)
    					b+='0';
    			else if(as<=bs)
    				for(int i=0;i<bs-as;i++)
    					a+='0';
    			if(a>b) cout<<'>'<<endl;
    			else if(a<b) cout<<'<'<<endl;
    				else cout<<'='<<endl; 
    		}
    		else if(as+x>bs+y) cout<<'>'<<endl;
    			else cout<<'<'<<endl;
    	}
        return 0;
    }
    
    • 1

    Information

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