Qpel

individuali uzd

Sep 12th, 2017
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.15 KB | None | 0 0
  1. print "Iveskite x"
  2. x=gets.to_i
  3.  
  4. if x<-40
  5.   y=3*x+1
  6. elsif x>=-20 and x<20
  7.   y=x+3
  8. elsif x>=30 and x<50
  9.   y=1+x
  10. else
  11.   y=5*x-1
  12. end
  13. puts "#{y}"
Add Comment
Please, Sign In to add comment