2 solutions

  • 0
    @ 2025-4-2 19:07:59
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int x1,y1,x2,y2;
    	cin>>x1>>y1>>x2>>y2;
    	int d1 = abs(x1) + abs(y1);
    	int d2 = abs(x2) + abs(y2);
    	if(d1 >= d2)
    	{
    	    cout<<"("<<x1<<","<<y1<<")"<<endl;
    	    cout<<d1<<endl;
    	} 
    	else 
    	{
    	    cout<<"("<<x2<<","<<y2<<")"<<endl;
    	    cout<<d2<<endl; 
    	}
    	return 0; 
    }
    
    • -3
      @ 2024-8-23 11:06:16

      #include<bits/stdc++.h> using namespace std; int main() { int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2; int d1 = abs(x1) + abs(y1); int d2 = abs(x2) + abs(y2); if(d1 >= d2) { cout<<"("<<x1<<","<<y1<<")"<<endl; } else { cout<<"("<<x2<<","<<y2<<")"<<endl; cout<<d2<<endl; } return 0; }

      • 1

      Information

      ID
      39
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      3
      Tags
      (None)
      # Submissions
      241
      Accepted
      60
      Uploaded By