Created
May 27, 2012 13:29
-
-
Save inohiro/2814217 to your computer and use it in GitHub Desktop.
atcoder3_A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
length = gets.to_i | |
str = gets | |
result = 0.0 | |
i = 0 | |
str.each_byte do |s| | |
case s | |
when 65 # A | |
result = result + 4.0 | |
when 66 # B | |
result = result + 3.0 | |
when 67 # C | |
result = result + 2.0 | |
when 68 # D | |
result = result + 1.0 | |
end | |
end | |
puts result / length | |
puts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment