Skip to content
Snippets Groups Projects
Commit 358ad10f authored by bg33novu's avatar bg33novu
Browse files

local vs global

parent de40f526
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,7 @@ println(triangle)
function is_Right1(lengths)
for i=1:length(lengths)
lengths[i] = lengths[i]^2
......@@ -146,6 +147,26 @@ println(is_Right!(triangle))
println(triangle)
function is_Right2ter(lengths)
squares = lengths
for i in 1:length(squares)
squares[i] = squares[i]^2
end
println(squares)
sort!(squares)
# squares = sort(squares)
println(squares)
return(squares[3] == squares[1] + squares[2])
end
triangle = [5, 3, 4]
println(is_Right2ter(triangle))
println(triangle)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment