https://www.acmicpc.net/problem/2753 윤년 def Q_2753() year = gets.chomp.to_i if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0 puts "1" else puts "0" end end Q_2753()
꾸준하게 하기
https://www.acmicpc.net/problem/9498 시험 성적 def Q_9498() jumsu = gets.chomp.to_i if jumsu >= 90 puts "A" elsif jumsu >= 80 puts "B" elsif jumsu >= 70 puts "C" elsif jumsu >= 60 puts "D" else puts "F" end end Q_9498()
https://www.acmicpc.net/problem/1330 두 수 비교하기 def Q_1330() str = gets.chomp.split(" ") numA = str[0].to_i numB = str[1].to_i if numA > numB puts ">" elsif numA < numB puts "
https://www.acmicpc.net/problem/25083 def Q_25083() puts " ,r'\"7\n" + "r`-_ ,' ,/\n" + " \\. \". L_r'\n" + " `~\\/\n" + " |\n" + " |" end Q_25083()
https://www.acmicpc.net/problem/10172 개 def Q_10172() puts "|\\_/|\n" + "|q p| /}\n" + "( 0 )\"\"\"\\\n" + "|\"^\"` |\n" + "||_/=\\\\__|" end Q_10172()
https://www.acmicpc.net/problem/2588 def Q_2588() numA = gets.to_i numB = gets.chomp numBs = numB.split("") i = numBs.length - 1 sumAB = numA * numB.to_i # (0..i).each do |data| # puts numA * numBs[i-data].to_i # end for data in 0..i puts numA * numBs[i-data].to_i end print sumAB end Q_2588()
https://www.acmicpc.net/problem/10171 고양이 def Q_10171() puts "\\ /\\" puts " ) ( ')" puts "( / )" puts " \\(__)|" end Q_10171()
https://www.acmicpc.net/problem/10430 문제요약 나머지를 구하는 문제 def Q_10430() str = gets.chomp arr = str.split(" ") numA = arr[0].to_i numB = arr[1].to_i numC = arr[2].to_i puts (numA + numB) % numC puts ((numA % numC) + (numB % numC)) % numC puts (numA * numB) % numC puts ((numA % numC) * (numB % numC))%numC end Q_10430()