Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 4.
- * კონსოლიდან შეიტანეთ მართკუთხედის სამი წვეროს X და Y კოორდინატები.
- * მართკუთხედის გვერდები საკოორდინატო გვერდების პარალელურია.
- * იპოვეთ მეოთხე წვეროს კოორდინატები და გამოიტანეთ კონსოლში.
- */
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication11
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] X = new int[4];
- int[] Y = new int[4];
- for (int i = 0; i < 3; i++)
- {
- X[i] = Convert.ToInt32(Console.ReadLine());
- Y[i] = Convert.ToInt32(Console.ReadLine());
- }
- if (X[0] == X[1])
- {
- X[3] = X[2];
- Console.WriteLine(X[3].ToString());
- }
- else if (X[0] == X[2])
- {
- X[3] = X[1];
- Console.WriteLine(X[3].ToString());
- }
- else if (X[1] == X[2])
- {
- X[3] = X[0];
- Console.WriteLine(X[3].ToString());
- }
- if (Y[0] == Y[1])
- {
- Y[3] = Y[2];
- Console.WriteLine(Y[3].ToString());
- }
- else if (Y[0] == Y[2])
- {
- Y[3] = Y[1];
- Console.WriteLine(Y[3].ToString());
- }
- else if (Y[1] == Y[2])
- {
- Y[3] = Y[0];
- Console.WriteLine(Y[3].ToString());
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment