Restructuring

This commit is contained in:
2024-07-01 13:49:44 +00:00
parent f11b705ef0
commit 8d60e1b905
194 changed files with 1296 additions and 112 deletions

View File

@ -0,0 +1,20 @@
tri = []
linenum = 0
ARGF.lines("\n") do |line|
tri[linenum] = Array.new
line.split.each do |str|
tri[linenum] << str.to_i
end
linenum += 1
end
(0..13).reverse_each do |y|
0.upto(tri[y].size()-1) do |x|
if( tri[y+1][x] > tri[y+1][x+1])
tri[y][x] = tri[y][x] + tri[y+1][x]
else
tri[y][x] = tri[y][x] + tri[y+1][x+1]
end
end
end
puts tri[0][0]