Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void exerciseNumberFour()
- {
- int x1, x2, y1, y2, a1, a2, b1, b2;
- Console.WriteLine("Podaj długość i szerokość prostokąta");
- Console.WriteLine("a1: ");
- a1 = Convert.ToInt32(Console.ReadLine());
- Console.Write("b1: ");
- b1 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Podaj współprzędne wierchołka: ");
- Console.WriteLine("x1: ");
- x1 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("y1 : ");
- y1 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Podaj długość i szerokość drugiego prostokąta");
- Console.WriteLine("a2: ");
- a2 = Convert.ToInt32(Console.ReadLine());
- Console.Write("b2: ");
- b2 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Podaj współprzędne wierchołka: ");
- Console.WriteLine("x2: ");
- x2 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("y2 : ");
- y2 = Convert.ToInt32(Console.ReadLine());
- if(((x1 + a1 < x2) || (y1 +b1 < y2) || (x1 > x2 + a2) || (y1 > y2 + b2)) && (0 < (a1 * b1 * a2 * b2)))
- {
- Console.WriteLine("Nie mają części wspólnych");
- }
- else
- {
- Console.WriteLine("Mają część wspólną");
- }
- Console.ReadKey();
- Console.Clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement