Created
December 18, 2019 12:55
-
-
Save lbbedendo/3dd14c6024b485a1e4475cc6ff6db3b2 to your computer and use it in GitHub Desktop.
staircase
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
import java.util.stream.IntStream | |
fun stair(n: Int) { | |
IntStream.range(1, n).forEach { | |
println(" ".repeat(n - it) + "#".repeat(it)) | |
} | |
} | |
fun main() { | |
print("Enter the stair size: ") | |
val n = readLine()!! | |
stair(n.toInt()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment