Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Triangle
- {
- class Program
- {
- static void Main(string[] args)
- {
- var a = decimal.Parse(Console.ReadLine());
- var b = decimal.Parse(Console.ReadLine());
- var c = decimal.Parse(Console.ReadLine());
- if (a < b + c && b < a + c && c < a + b)
- {
- if (a == b && b == c)
- {
- Console.WriteLine("Triangle with sides {0:F0}, {1:F0} and {2:F0} is equilateral.",
- a, b, c);
- }
- else if (a == b)
- {
- Console.WriteLine("Triangle with sides {0:F0}, {1:F0} and {2:F0} is isosceles.",
- a, b, c);
- }
- else
- {
- Console.WriteLine("Triangle with sides {0:F0}, {1:F0} and {2:F0} is scalene.",
- a, b, c);
- }
- }
- else
- {
- Console.WriteLine("There is no triangle with sides {0:F0}, {1:F0} and {2:F0}.",
- a, b, c);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement