parent
6b174ee400
commit
f240d327b7
|
@ -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:
|
||||
#
|
||||
###
|
||||
#####
|
||||
#######
|
||||
*/
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue