24 lines
310 B
Ruby
Executable File
24 lines
310 B
Ruby
Executable File
#!/usr/bin/ruby
|
|
# -*- coding: utf-8 -*-
|
|
|
|
=begin
|
|
점수(0~100)를 받아 A/B/C/D/F 등급 출력
|
|
=end
|
|
|
|
print "점수(0~100) : "
|
|
number = gets.chomp.to_i
|
|
|
|
grade = case number
|
|
when 90..100
|
|
"A"
|
|
when 80..89
|
|
"B"
|
|
when 70..79
|
|
"C"
|
|
when 60..69
|
|
"D"
|
|
else
|
|
"F"
|
|
end
|
|
puts "#{number}점은 #{grade} 등급입니다."
|