ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป ๋ฌธ์ œ

 

9498๋ฒˆ: ์‹œํ—˜ ์„ฑ์ 

์‹œํ—˜ ์ ์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ 90 ~ 100์ ์€ A, 80 ~ 89์ ์€ B, 70 ~ 79์ ์€ C, 60 ~ 69์ ์€ D, ๋‚˜๋จธ์ง€ ์ ์ˆ˜๋Š” F๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

www.acmicpc.net


โœ๐Ÿป ํ’€์ด

๐ŸŽจ Go

package main

import (
	"fmt"
)

func main() {
	var score int
	var grade string
	fmt.Scanf("%d", &score)
	if 90 <= score {
		grade ="A"
	} else if 80 <= score{
		grade = "B"
	} else if 70 <= score {
		grade = "C"
	} else if 60 <= score {
		grade = "D"
	} else {
		grade = "F"
	}
	fmt.Println(grade)
}

๐ŸŽจ Python3

import sys

score = int(sys.stdin.readline())

if score >= 90:
    grade = 'A'
elif score >= 80:
    grade = 'B'
elif score >= 70:
    grade = 'C'
elif score >= 60:
    grade = 'D'
else:
    grade = 'F'

print(grade)
728x90
๋Œ“๊ธ€