Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.