Computer Science/Jongol (정올)

[Jongol] 기초다지기 : 선택제어문

꿈꾸는어린이 2018. 1. 2. 15:42

//

일시 : 2018.01.02 14:00pm ~ 16:00pm

장소 : 멀티스퀘어 12F

내용 : Jongol 문제풀이 (기초다지기 선택제어문 부분)

//

528

  a = int(input())

print(a)

if a < 0 :
print("minus")


529

  var_str = raw_input()
var_list = var_str.split()

height = int(var_list[0])
weight = int(var_list[1])

ob = weight + 100 - height
print(ob)

if ob > 0 :
print("Obesity")


530

  age = int(input())
later = 20 - age

if age >= 20 :
print("adult")
else :
print("%d years later" % later)


531

  weight = float(input())

if weight <= 50.80 :
print("Flyweight")
elif weight <= 61.23 :
print("Lightweight")
elif weight <= 72.57 :
print("Middleweight")
elif weight <= 88.45 :
print("Cruiserweight")
else :
print("Heavyweight")


532

  • 점수 변수 받을 때 실수형으로 변환 -> 변환 안해주면 제대로 된 결과가 안나옴.

  
a, b =raw_input().split()

a = float(a)
b = float(b)

if ((a>=4.0) and (b>=4.0)) :
print("A")
elif ((a>=3.0) and (b>=3.0)) :
print("B")
else :
print("C")


533

  gender, age = raw_input().split()

age = int(age)

if ((gender=='M') and (age >= 18)) :
print("MAN")
elif ((gender=='F') and (age >= 18)) :
print("WOMAN")
elif ((gender=='M') and (age < 18)) :
print("BOY")
elif ((gender=='F') and (age < 18)) :
print("GIRL")


534 ★★

  
score = raw_input()

if (score == 'A'):
print("Excellent")
elif (score == 'B') :
print("Good")
elif (score == 'C') :
print("Usually")
elif (score == 'D') :
print("Effort")
elif (score == 'F') :
print("Failure")
else :
print("error")


535

  score = float(input())

if score >= 4.0 :
print("scholarship")
elif score >= 3.0 :
print("next semester")
elif score >= 2.0 :
print("seasonal semester")
else :
print("retake")


632

  a, b, c = raw_input().split()

a = int(a)
b = int(b)
c = int(c)
min = 0

if a < b :
min = a
else :
min = b

if c < min:
min = c

print(min)


120 : 선택제어문 - 형성평가1

  a, b = raw_input().split()

a = int(a)
b = int(b)

if a > b :
print(a-b)
else :
print(b-a)


121

  a = raw_input()

a = int(a)

if a == 0 :
print("zero")
elif a > 0 :
print("plus")
else :
print("minus")


122

  year = raw_input()

year = int(year)

if (year % 400 == 0) or ((year % 4 == 0) and (year % 100 != 0)) :
print("leap year")
else :
print("common year")


123

  
num = int(raw_input("Number? "))

if num == 1:
print("dog")
elif num == 2 :
print("cat")
elif num == 3 :
print("chick")
else :
print("I don't know.")


124

  num = int(raw_input())

if (num == 1) or (num == 3) or (num == 5) or (num == 7) or (num == 8) or (num ==10) or (num ==12) :
print(31)
elif num == 2 :
print(28)
else :
print(30)