Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
579 B
0
Indexable
Never
#include <iostream>
#include <fstream>
#include <stdint.h>
#include <algorithm>
#include <string>
#include "Header.h" 
using namespace std;
struct an {
	int a, b;
	float c;
};
bool comp(const an& a, const an& b)
{
	bool h = a.c > b.c;
	return h;
}
int main() {

	int a;
	int x, y;
	cin >> a;
	vector<an> mass;
	for (int i = 0; i < a; i++){
		cin >> x >> y;
		an k;
		k.a = x;
		k.b = y;
		k.c = sqrt(x * x + y * y);
		mass.push_back(k);
	}
	sort(mass.begin(), mass.end(), comp);
	for (an h : mass) {
		cout << h.a << ' ' << h.b << '\n';
	}


}