Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Pitagorasz
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int a,b;
- double c;
- Console.Clear();
- Console.WriteLine("Pitagorasz tétel?\n---------------------------------\n");
- Console.Write("Kérem az A oldalt: ");
- a = int.Parse(Console.ReadLine());
- Console.Write("Kérem az B oldalt: ");
- b = int.Parse(Console.ReadLine());
- if (a<1 || b<1) Console.WriteLine("Negatív számot adtál meg!");
- else{
- c=a*a+b*b;
- c= Math.Sqrt(c);
- Console.WriteLine("A C oldal hossza: {0}",c);
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement