Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int[] x=new int[10];
- int[] y=new int[10];
- for (int i = 0; i < 10; i++)
- {
- x[i] = Console.Read();
- y[i] = Console.Read();
- }
- double najvece_rastojanje = 0.0;
- int tacka1=0;
- int tacka2=0;
- for (int i=0; i<10; i++)
- {
- for (int j=i+1; j<10; j++)
- {
- double rastojanje = Math.Sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
- if (rastojanje > najvece_rastojanje)
- {
- najvece_rastojanje = rastojanje;
- tacka1 = i;
- tacka2 = j;
- }
- }
- }
- Console.WriteLine("Koordinate prve tacke: {0} {1}", x[tacka1], y[tacka1]);
- Console.WriteLine("Koordinate druge tacke: {0} {1}", x[tacka2], y[tacka2]);
- Console.WriteLine("Njihovo rastojanje: {0}", najvece_rastojanje);
- Console.Read();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement