Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double x;
- double y;
- double wynik;
- try
- {
- Console.WriteLine("Podaj pierwszą przekątną");
- x = Convert.ToDouble(Console.ReadLine())
- Console.WriteLine("Podaj drugą przekątną");
- y = Convert.ToDouble(Console.ReadLine());
- if (x > 0 && y > 0)
- {
- wynik = Math.Sqrt(x * x + y * y);
- Console.WriteLine(wynik);
- }
- else
- {
- }
- }
- catch (FormatException)
- {
- Console.WriteLine("Przekątna musi być liczbą");
- //throw;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement