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}, {1} and {2} is equilateral.",
- a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
- }
- else if (a == b)
- {
- Console.WriteLine("Triangle with sides {0}, {1} and {2} is isosceles.",
- a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
- }
- else
- {
- Console.WriteLine("Triangle with sides {0}, {1} and {2} is scalene.",
- a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
- }
- }
- else
- {
- Console.WriteLine("There is no triangle with sides {0}, {1} and {2}.",
- a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement