Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "Masukkan tinggi : "
- x=gets.to_i
- puts ""
- temp=x
- i=1
- while i<=x
- k=1
- while temp >= 1
- print " "
- temp -=1
- end
- while k<=i
- print "* "
- k+=1
- end
- temp=x-i
- i+=1
- puts ""
- end
- //Sumber : http://blograhmatfadli.blogspot.co.id/2011/05/membuat-segitiga-pada-ruby.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement