static void Main(string[] args) { double A, B, C; double TRIANGULO, CIRCULO, TRAPEZIO, QUADRADO, RETANGULO; double pi = 3.14159; string[] vet; vet = Console.ReadLine().Split(' '); A = Double.Parse(vet[0], CultureInfo.InvariantCulture); B = double.Parse(vet[1], CultureInfo.InvariantCulture); C = double.Parse(vet[2], CultureInfo.InvariantCulture); TRIANGULO = A * C / 2; CIRCULO = pi * Math.Pow(C, 2.0); TRAPEZIO = (A + B) * C / 2; QUADRADO = Math.Pow(B, 2.0); RETANGULO = A * B; Console.WriteLine("TRIANGULO: " + TRIANGULO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("CIRCULO: " + CIRCULO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("TRAPEZIO: " + TRAPEZIO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("QUADRADO: " + QUADRADO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("RETANGULO: " + RETANGULO.ToString("F3", CultureInfo.InvariantCulture)); Console.ReadLine(); }
static void Main(string[] args) { double A, B, C, TRIANGULO, CIRCULO, TRAPEZIO, QUADRADO, RETANGULO; string[] vet; vet = Console.ReadLine().Split(' '); A = double.Parse(vet[0], CultureInfo.InvariantCulture); B = double.Parse(vet[1], CultureInfo.InvariantCulture); C = double.Parse(vet[2], CultureInfo.InvariantCulture); TRIANGULO = A * C / 2; CIRCULO = 3.14159 * C * C; TRAPEZIO = (B + A) * C / 2; QUADRADO = B * B; RETANGULO = A * B; Console.WriteLine("TRIANGULO: " + TRIANGULO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("CIRCULO: " + CIRCULO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("TRAPEZIO: " + TRAPEZIO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("QUADRADO: " + QUADRADO.ToString("F3", CultureInfo.InvariantCulture)); Console.WriteLine("RETANGULO: " + RETANGULO.ToString("F3", CultureInfo.InvariantCulture)); Console.ReadLine(); }
static void Main(string[] args) { double A, B, C, TRIANGULO, CIRCULO, TRAPEZIO, QUADRADO, RETANGULO; A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); C = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); TRIANGULO = (A * C) / 2; CIRCULO = C * C * 3.14159; TRAPEZIO = ((A + B) * C) / 2; QUADRADO = B * B; RETANGULO = A * B; Console.WriteLine("TRIANGULO: " + TRIANGULO.ToString("F3"), CultureInfo.InvariantCulture); Console.WriteLine("CIRCULO: " + CIRCULO.ToString("F3"), CultureInfo.InvariantCulture); Console.WriteLine("TRAPEZIO: " + TRAPEZIO.ToString("F3"), CultureInfo.InvariantCulture); Console.WriteLine("QUADRADO: " + QUADRADO.ToString("F3"), CultureInfo.InvariantCulture); Console.WriteLine("RETANGULO: " + RETANGULO.ToString("F3"), CultureInfo.InvariantCulture); }
static void Main(string[] args) { double A, B, C, PI, TRIANGULO, CIRCULO, TRAPEZIO, QUADRADO, RETANGULO; String[] vet = Console.ReadLine().Split(' '); A = double.Parse(vet[0]); B = double.Parse(vet[1]); C = double.Parse(vet[2]); PI = 3.14159; TRIANGULO = (A * C) / 2.0; CIRCULO = PI * Math.Pow(C, 2.0); TRAPEZIO = ((A + B) * C) / 2.0; QUADRADO = Math.Pow(B, 2.0); RETANGULO = A * B; Console.WriteLine("TRIANGULO: " + TRIANGULO.ToString("F3")); Console.WriteLine("CIRCULO: " + CIRCULO.ToString("F3")); Console.WriteLine("TRAPEZIO: " + TRAPEZIO.ToString("F3")); Console.WriteLine("QUADRADO: " + QUADRADO.ToString("F3")); Console.WriteLine("RETANGULO: " + RETANGULO.ToString("F3")); }