Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace pitagrasztetel
- {
- class Program
- {
- static double atfogo(double a, double b, out double T)
- {
- double c = Math.Sqrt(a * a + b * b);
- T = (a * b) / 2;
- return c;
- }
- static void Main(string[] args)
- {
- double a, b, t;
- while (true)
- {
- Console.Write("Befogó A: ");
- a = double.Parse(Console.ReadLine());
- Console.Write("Befogó B: ");
- b = double.Parse(Console.ReadLine());
- if (a <= 0 || b <= 0) break;
- Console.WriteLine("A háromszög befogói a={0}, b={1}, c={2}, Terület T={3}", a, b, atfogo(a, b, out t), t);
- Console.WriteLine("Kólity Kristóf");
- Console.WriteLine("Enter nyomásával újraindítható a program.");
- Console.ReadLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment