Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. double x;
  2. double y;
  3. double wynik;
  4.  
  5.  
  6.  
  7. try
  8. {
  9. Console.WriteLine("Podaj pierwszą przekątną");
  10. x = Convert.ToDouble(Console.ReadLine())
  11. Console.WriteLine("Podaj drugą przekątną");
  12. y = Convert.ToDouble(Console.ReadLine());
  13. if (x > 0 && y > 0)
  14. {
  15. wynik = Math.Sqrt(x * x + y * y);
  16. Console.WriteLine(wynik);
  17. }
  18. else
  19. {
  20.  
  21. }
  22. }
  23. catch (FormatException)
  24. {
  25. Console.WriteLine("Przekątna musi być liczbą");
  26. //throw;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement