Advertisement
Qpel

menesiai

Sep 12th, 2017
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.51 KB | None | 0 0
  1. print "Iveskite metus: "
  2. metai=gets.to_i
  3. print "Iveskite menesi: "
  4. menuo=gets.chomp
  5.  
  6.  
  7. case menuo
  8. when '1'
  9.   puts "31d."
  10. when '2'
  11.   if(metai % 400 == 0 || (metai % 100 != 0 && metai % 4 == 0))
  12.   puts "29d."
  13.  else
  14.   puts "28d."
  15.   end
  16.  when '3'
  17.    puts "31d."
  18.  when '4'
  19.    puts "30d."
  20.  when '5'
  21.    puts "31d."
  22.  when '6'
  23.    puts "30d."
  24.  when '7'
  25.    puts "31d."
  26.  when '8'
  27.    puts "31d."
  28.  when '9'
  29.    puts "30d."
  30.  when '10'
  31.    puts "31d."
  32.  when '11'
  33.    puts "30d."
  34.  when '12'
  35.    puts "31d."
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement