Cómo utilizar VS2005 para programar la relación entre los tres lados de un triángulo
Escribí un fragmento de código en C#, no sé si hay algún problema.
usando System;
usando System.Collections.Generic;
usando System.Text;
espacio de nombres ConsoleApplication1
{
clase Programa
{
static void Main(string[] args)
{
mientras (verdadero)
{
int a = 0;
int b = 0
int c = 0; /p>
String s = null;
Console.Out.WriteLine("\nIngrese un valor: ");
Console.Out.Write("a= ");
s = Console.ReadLine();
if (!int.TryParse(s, out a))
{
Console.Out.WriteLine("¡Entrada ilegal!");
continuar
}
Console.Out.Write("b="; );
s = Console.ReadLine();
if (!int.TryParse(s, out b))
{
Console.Out.WriteLine("¡Entrada ilegal!");
continuar
}
Console.Out.Write("c=") ;
s = Console.ReadLine();
if (!int.TryParse(s, out c))
{
Console.Out.WriteLine("¡Entrada ilegal! ");
continuar;
}
si (a b lt; = c || a c lt; = b || b c lt; =
a)
{
Console.Out.WriteLine("¡Entrada ilegal!"
}
else if (a =); = b amp; b == c)
{
Console.Out.WriteLine("Triángulo equilátero");
}
else if (a == b || b == c || a == c)
{
Console.Out.WriteLine("Triángulo isósceles" );
}
else
{
Console.Out.WriteLine("Triángulo general"); }
}
}
}
}