Last active
February 5, 2018 06:22
-
-
Save TranNgocMinh/b93f51680738da73c0b0f4d2b82d7c61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isTriangle = true; | |
char OK = 'Y'; | |
float a,b,c; | |
do | |
{ | |
Console.WriteLine("Nhap a = "); | |
a = float.Parse(Console.ReadLine()); | |
Console.WriteLine("Nhap b = "); | |
b = float.Parse(Console.ReadLine()); | |
Console.WriteLine("Nhap c = "); | |
c = float.Parse(Console.ReadLine()); | |
if(a<=0 || b<=0 || c<=0) | |
isTriangle = false; | |
if((a + b <= c) || (a + c <= b) || (b + c <= a)) | |
isTriangle = false; | |
if(isTriangle) | |
Console.WriteLine("Day la tam giac"); | |
else | |
Console.WriteLine("Day khong phai la tam giac"); | |
isTriangle = true; | |
Console.WriteLine("Ban muon tiep tuc khong?(Y/N)"); | |
OK = Console.ReadKey().KeyChar; | |
} while(OK != 'N'); | |
Console.ReadKey(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment