#include <iostream>
#include <cmath>
using namespace std;
struct complex { double re,im; };
void citire(complex &c)
{
cin>>c.re>>c.im;
}
void citire(complex C[], int &n)
{
cin>>n;
for(int i=1;i<=n;i++)
citire(C[i]);
}
double modul(complex c)
{
return sqrt(c.re*c.re+c.im*c.im);
}
void inter(double &a, double &b)
{
double aux=a; a=b; b=aux;
}
void ordonare(double A[], int n)
{
for(int i=1;i<n;i++)
for(int j=i+1;j<=n;j++)
if(A[i]>A[j])
inter(A[i],A[j]);
}
void afisare(double A[], int n)
{
for(int i=1;i<=n;i++)
cout<<A[i]<<" ";
}
int main()
{
int n,m=0;
double a,b;
complex C[101];
double A[101];
citire(C,n);
cin>>a>>b;
for(int i=1;i<=n;i++)
if(modul(C[i])<a || modul(C[i])>b)
A[++m]=modul(C[i]);
ordonare(A,m);
afisare(A,m);
return 0;
}
|