Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- using System.IO;
- namespace ConsoleApp1
- {
- class GlobalVar
- {
- public double R;
- }
- struct SPoint : IComparable<SPoint>
- {
- public int x, y;
- private int countOfPoint;
- public SPoint(int x, int y)
- {
- this.x = x; this.y = y;
- countOfPoint = 0;
- }
- public void calculate(SPoint cur, SPoint [] a)
- {
- for (int i = 0; i < a.Length;++i)
- if (Distance)
- }
- public void Show()
- {
- Console.WriteLine("({0}, {1})", x, y);
- }
- private double sqr(double a)
- {
- return a * a;
- }
- public double Distance(SPoint a, SPoint b)
- {
- return Math.Sqrt(sqr);
- }
- public int CompareTo(SPoint obj)
- {
- if (this.Distance() == obj.Distance())
- {
- return 0;
- }
- else
- {
- if (this.Distance() > obj.Distance())
- {
- return 1;
- }
- else
- {
- return -1;
- }
- }
- }
- }
- class Program
- {
- static void Print(SPoint[] array) //выводим данные на экран
- {
- foreach (SPoint item in array)
- {
- item.Show();
- }
- }
- static void Main()
- {
- int n = Int32.Parse(Console.ReadLine());
- SPoint[] array = new SPoint[n];
- GlobalVar global = new GlobalVar();
- global.R = Double.Parse(Console.ReadLine());
- Array.Sort(array); //Вызов стандартной сортировки для класса Array
- Console.WriteLine("Упорядоченные данные: ");
- Print(array);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement