Posted By

Josemaria on 07/18/11


Tagged

hola mundo


Versions (?)

Conversor.rb


 / Published in: Ruby
 

Un conversor de pesetas a euros

  1. def peseta_a_euro(pesetas)
  2. return pesetas/166.386
  3. end
  4.  
  5.  
  6. puts "cantidad de pesetas"
  7. pesetas = gets.chomp.to_i
  8. euros = peseta_a_euro(pesetas)
  9.  
  10. puts "#{pesetas} son #{euros} euros"

Report this snippet  

You need to login to post a comment.