Using System; using System. Collections. Generic



Yüklə 14,05 Kb.
tarix22.05.2023
ölçüsü14,05 Kb.
#119854
AZ1223.tttttt


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication28


{
struct Point
{
public double x, y;

public Point(double x, double y) { this.x = x; this.y = y; }


public double Uzunlik() { return Math.Sqrt(x * x + y * y); }
class Program
{
static void Masofa(Point[] a,int n)
{
Console.Write("k=");
int k = Convert.ToInt32(Console.ReadLine());
Point[] p = new Point[k];
for (int i = 0; i < k; i++)
{
p[i].x = a[i].x;
p[i].y = a[i].y;

}
for (int i = 0; i
{
if (Math.Pow((a[i].x - a[0].x), 2) + Math.Pow((a[i].y - a[0].y), 2) < Math.Pow((a[i].x - a[1].x), 2) + Math.Pow((a[i].y - a[1].y), 2))
Console.WriteLine("Natija: ({0};{1}) ({2};{3})", a[0].x, a[0].y, a[i].x, a[i].y);
else
Console.WriteLine("natija:({0};{1}) ({2};{3})", a[1].x, a[1].y, a[i].x, a[i].y);
}

}
}
}


static void Main(string[] args)
{
Console.Write("n=");
int n = Convert.ToInt32(Console.ReadLine());
Point[] a = new Point[n];
for (int i = 0; i < n; i++)
{
a[i].x = Convert.ToDouble(Console.ReadLine());
a[i].y = Convert.ToDouble(Console.ReadLine());
}
Masofa(a,n);
Console.ReadKey();
}
}
}
}
Yüklə 14,05 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin