Skip to content

Instantly share code, notes, and snippets.

@vovs03
Last active December 8, 2017 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vovs03/6d7041bbc93b7e750eb73c5f811dbfc5 to your computer and use it in GitHub Desktop.
Save vovs03/6d7041bbc93b7e750eb73c5f811dbfc5 to your computer and use it in GitHub Desktop.
Inspecting the logest words(string) [Выбор большего из аргументов]
#longest.rb
#puts "Now we can inspecting wich of words is longest"
puts "Input the first word."
a1 = gets.to_s
puts "Input the second word."
a2 = gets.to_s
puts "Result:"
#puts a1, a1.length-1
#puts a2, a2.length-1
def longest(a1,a2)
if a1.length-1 > a2.length-1
puts a1, a1.length-1
else
puts a2, a2.length-1
end
end
puts longest(a1,a2)
@vovs03
Copy link
Author

vovs03 commented Dec 7, 2017

долго бился над тем, что оказывается я не вызывал метод ) не хватало строки 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment