Quick actions

cmd+k|ctrl+k

Navigation

Languages

task 80

Snippet info

Language

Cpp

Visibility

public

Author

niktyutenko

Created

2018-10-14T09:31:15Z

Updated

2018-11-21T10:36:42Z

#include <iostream>
#include <math.h>
using namespace std;

int main() {
    double x1,y1,x2,y2;
    cin >> x1;
    cin >> y1;
    cin >> x2;
    cin >> y2;
    
    double m1 = sqrt(x1*x1+y1*y1);
    double m2 = sqrt(x2*x2+y2*y2);
    
    if (m1<m2) {
        cout << "A ближе" << endl;
    }
    else {
        if (m1>m2) {
         cout << "B ближе" << endl;  
        }
    }
    return 0;
}
INFO