Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- Console.WriteLine("Введите 1 сторону");
- int a = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите 2 сторону");
- int b = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите 3 сторону");
- int c = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Результат " + isTriangle(a,b,c));
- }
- }
- static bool isTriangle(int a,int b, int c)
- {
- if( a <= 0 || b <= 0 || c <= 0)
- {
- return false;
- }
- if ( a + b > c && a + c > b && b + c > a)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement