Advertisement
eitanfuturo

QuickMail

May 13th, 2021
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.27 KB | None | 0 0
  1. 1.upto 100 do | each |
  2.   first_condition = each % 3 == 0
  3.   second_condition = each % 5 == 0
  4.  
  5.   if first_condition && second_condition
  6.     puts 'PingPong'
  7.   elsif first_condition
  8.     puts 'Ping'
  9.   elsif second_condition
  10.     puts 'Pong'
  11.   else
  12.     puts each
  13.   end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement