mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-07 15:01:58 +08:00
chore: update driver code (#1265)
This commit is contained in:
@ -62,17 +62,18 @@ def nested_for_loop(n)
|
||||
end
|
||||
|
||||
### Driver Code ###
|
||||
if __FILE__ == $0
|
||||
n = 5
|
||||
|
||||
n = 5
|
||||
res = for_loop(n)
|
||||
puts "\nfor 循环的求和结果 res = #{res}"
|
||||
|
||||
res = for_loop(n)
|
||||
puts "\nfor 循环的求和结果 res = #{res}"
|
||||
res = while_loop(n)
|
||||
puts "\nwhile 循环的求和结果 res = #{res}"
|
||||
|
||||
res = while_loop(n)
|
||||
puts "\nwhile 循环的求和结果 res = #{res}"
|
||||
res = while_loop_ii(n)
|
||||
puts "\nwhile 循环(两次更新)求和结果 res = #{res}"
|
||||
|
||||
res = while_loop_ii(n)
|
||||
puts "\nwhile 循环(两次更新)求和结果 res = #{res}"
|
||||
|
||||
res = nested_for_loop(n)
|
||||
puts "\n双层 for 循环的遍历结果 #{res}"
|
||||
res = nested_for_loop(n)
|
||||
puts "\n双层 for 循环的遍历结果 #{res}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user