Skip to content

Instantly share code, notes, and snippets.

@TranNgocMinh
Created February 6, 2018 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TranNgocMinh/788eb00172e58d0127fd622c262f18cb to your computer and use it in GitHub Desktop.
Save TranNgocMinh/788eb00172e58d0127fd622c262f18cb to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
var S = 0
print("Nhap n = ")
var n = readLine()!!.toInt()
for(i in 1..n)
S=S+i
print("Tong la: $S")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment