0
Why it shows error
puts "Put your mom\'s age" x = gets if x>18 puts "Your mom good :) " else puts "your mom gae" end #why error
3 ответов
0
Try doing
x = gets.chomp.to_i
0
If you put "Put your mom's age" it will not work as it will be picked up by Ruby as'Put your mom' instead of 'Put your mom\'s age'
0
In the 'x = gets.chomp.to_i' the 'to_i' asigns the input to a variable