1
1
Fork 0

Update Task.kt

Triangle rather than Pyramid
This commit is contained in:
Bruce Eckel 2019-07-28 16:15:28 -06:00 committed by GitHub
parent 6b174ee400
commit f240d327b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
package summary3
fun printPyramid(n: Int) {
fun printTriangle(n: Int) {
for (i in 1..n) {
repeat(n - i) {
print(' ')
@ -13,11 +13,11 @@ fun printPyramid(n: Int) {
}
fun main() {
printPyramid(4)
printTriangle(4)
}
/* Output:
#
###
#####
#######
*/
*/