Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x, y, z;
- bool isCorrect;
- Console.WriteLine( "Задайте x");
- string line = Console.ReadLine();
- if (!double.TryParse(line,out x))
- return;
- Console.WriteLine( "Задайте y");
- line = Console.ReadLine();
- if (!double.TryParse(line, out y))
- return;
- Console.WriteLine( "Задайте z");
- line = Console.ReadLine();
- if (!double.TryParse(line, out z))
- return;
- Console.WriteLine( Geron(x,y,z) );
- }
- static double Geron(double a, double b, double c)
- {
- double p = (a + b + c)/2.0;
- return Math.Sqrt(p*(p - a)*(p - b)*(p - c));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement