Created
February 6, 2018 04:34
-
-
Save TranNgocMinh/48d19e83bee9e8c4a41d45ef827e2fe1 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
fun main(args: Array<String>) { | |
var isTriangle = true | |
var OK = 'Y' | |
do { | |
print("Nhap a = ") | |
var a = readLine()!!.toFloat() | |
print("Nhap b = ") | |
var b = readLine()!!.toFloat() | |
print("Nhap c = ") | |
var c = readLine()!!.toFloat() | |
if (a <= 0 || b <= 0 || c <= 0) | |
isTriangle = false | |
if ((a + b <= c) || (a + c <= b) || (b + c <= a)) | |
isTriangle = false | |
if (isTriangle) | |
print("Day la tam giac") | |
else | |
print("Day khong phai la tam giac") | |
isTriangle = true | |
print("Ban muon tiep tuc khong?(Y/N)") | |
OK = readLine()!!.first() | |
}while(OK != 'N') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment