29
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
float n, lado, ap, area;
8
Console.WriteLine("¿Cuántos lados tiene el polígono?");
9
n = Convert.ToInt32(Console.ReadLine());
10
Console.WriteLine("¿Cuántos miden esos lados?");
11
lado = Convert.ToInt32(Console.ReadLine());
12
Console.WriteLine("¿Cuánto mide el apotema?");
13
ap = Convert.ToInt32(Console.ReadLine());
14
area = calcular_area(n, lado, ap);
15
Console.WriteLine("El área del polígono es de " + area.ToString());
16
}
17
18
public static float calcular_area(float n, float lado, float ap)
19
{
20
float area;
21
area = perimetro(n, lado) * ap / 2;
22
return area;
23
}
24
25
public static float perimetro(float n, float lado)
26
{
27
return n * lado;
28
}
29
}
Cached Result
Compilation error (line 2, col 7): The type or namespace name 'BenchmarkDotNet' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 3, col 7): The type or namespace name 'BenchmarkDotNet' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 9, col 6): The type or namespace name 'BenchmarkAttribute' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 9, col 6): The type or namespace name 'Benchmark' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 15, col 6): The type or namespace name 'BenchmarkAttribute' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 15, col 6): The type or namespace name 'Benchmark' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 34, col 9): The name 'BenchmarkRunner' does not exist in the current context
Compilation error (line 3, col 7): The type or namespace name 'BenchmarkDotNet' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 9, col 6): The type or namespace name 'BenchmarkAttribute' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 9, col 6): The type or namespace name 'Benchmark' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 15, col 6): The type or namespace name 'BenchmarkAttribute' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 15, col 6): The type or namespace name 'Benchmark' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 34, col 9): The name 'BenchmarkRunner' does not exist in the current context