Problem:

Grading

  Write a program which reads a list of student test scores and evaluates the performance for each student.

  The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.

  The final performance of a student is evaluated by the following procedure:

  
If the student does not take the midterm or final examination, the student's grade shall be F.

  
If the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.

  
If the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.

  
If the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.

  
If the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.

  
If the total score of the midterm and final examination is less than 30, the student's grade shall be F.

Input

  The input consists of multiple datasets. For each dataset, three integers m, f and r are given in a line.

  The input ends with three -1 for m, f and r respectively. Your program should not process for the terminal symbols.

The number of datasets (the number of students) does not exceed 50.

Output

  For each dataset, print the grade (A, B, C, D or F) in a line.

Sample Input

40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Sample Output

A
C
F



Sample input:
40 42 -1
20 30 -1
0 2 -1
-1 -1 -1


Sample output:
A
C
F

Submission status: Accepted

Solution code:
grades = []
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        grades.append('F')
        continue
    if m + f >= 80:
        grades.append('A')
        continue
    if m + f >= 65:
        grades.append('B')
        continue
    if m + f >= 50:
        grades.append('C')
        continue
    if m + f >= 30:
        if r >= 50:
            grades.append('C')
            continue
        else:
            grades.append('D')
            continue
    if m + f < 30:
        grades.append('F')

for grade in grades:
    print(grade)

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    elif m==-1 or f==-1:
        print("F")
    elif m+f>=80:
        print("A")
    elif 80>m+f>=65:
        print("B")
    elif 65>m+f>=50:
        print("C")
    elif 50>m+f>=30:
        if r>=50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
def seiseki(list):
    goukei = list[0]+list[1]
    saishiken = list[2]
    if (list[0]==-1) or (list[1]==-1) or (goukei<30):
        return 'F'
    elif (goukei >= 80):
        return 'A'
    elif (goukei >= 65):
        return 'B'
    elif (goukei >= 50) or (saishiken >= 50):
        return 'C'
    else:
        return 'D'

flag = True
a = []

while flag:
    t = list(map(int, input().split()))
    if (t[0] == -1) and (t[1] == -1) and (t[2] == -1):
        flag = False
        continue
    a.append(t)
for i in a:
    str = seiseki(i)
    print(str)

Submission status: Accepted

Solution code:
while True:
  m, f, r = list(map(int, input().split()))
  ABSENT = m==-1 or f==-1
  A = 80<=m+f 
  B = 65<=m+f<80
  C = 50<=m+f<65
  D = 30<=m+f<50
  DC = D and 50<=r
  F = m+f<30
  if m == f == r == -1:
    break
  elif ABSENT or F:
    print("F")
  elif A:
    print("A")
  elif B:
    print("B")
  elif C or DC:
    print("C")
  elif D:
    print("D")

Submission status: Accepted

Solution code:
while True:
    m, r, f = map(int, input().split())
    grade = "null"

    if m == -1 and r == -1 and f == -1:
        break

    if m + r >= 80:
        grade = "A"
    elif m + r >= 65 and m + r < 80:
        grade = "B"
    elif m + r >= 50 and m + r < 65:
        grade = "C"
    elif m + r >= 30 and m + r < 50:
        grade = "D"
    elif m + r <= 30:
        grade = "F"

    if grade == "D" and f >= 50:
        grade = "C"

    if m == -1 or r == -1:
        grade = "F"

    print(grade)

Submission status: Accepted

Solution code:
while True:
  m, f, r = [int(n) for n in input().split()]
  if m == f == r == -1:
    break
  if m == -1 or f == -1:
    print('F')
    continue
  if 80 <= m+f:
    print('A')
    continue
  if 65 <= m+f < 80:
    print('B')
    continue
  if 50 <= m+f < 65:
    print('C')
    continue
  if 30 <= m+f < 50:
    if 50 <= r:
      print('C')
    else:
      print('D')
    continue
  if m+f < 30:
    print('F')

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    else:
        if m == -1 or f == -1:
            print('F')
        elif m + f >= 80:
            print('A')
        elif m + f >= 65:
            print('B')
        elif m + f >= 50:
            print('C')
        elif m + f >= 30:
            if r >= 50:
                print('C')
            else:
                print('D')
        else:
            print('F')

Submission status: Accepted

Solution code:
while True:
    test = list(map(int,input().split()))
    a = int(test[0])+int(test[1])
    if int(test[0]) == -1 and int(test[1]) == -1 and int(test[2]) == -1:
        break
    elif int(test[0])==-1 or int(test[1])==-1:
        print('F')
    elif a>=80:
        print('A')
    elif (a>=65)and(a<80):
        print('B')
    elif (a>=50)and(a<65):
        print('C')
    elif (a>=30)and(a<50):
        if int(test[2])>=50:
            print('C')
        else:
            print('D')
    elif a<30:
        print('F')

Submission status: Accepted

Solution code:
while True :
    m,f,r = map(int,input().split(" "))

    if (m == -1) and (f == -1) and (r == -1):
        break
    goukei = m + f

    if (m == -1) or (f == -1) or (goukei < 30):
        print("F")
    elif goukei >= 80 :
        print("A")
    elif goukei >= 65 :
        print("B")
    elif goukei >= 50 :
        print("C")
    elif goukei >= 30 :
        if r >= 50 :
            print("C")
        else :
            print("D")

Submission status: Accepted

Solution code:
while 1:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    
    sc  = m + f
    if m == -1 or f == -1:  print('F')
    elif 79 < sc:           print('A')
    elif 64 < sc:           print('B')
    elif 49 < sc:           print('C')
    elif 29 < sc:
        if 49 < r:          print('C')
        else:               print('D')
    else:                   print('F')

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,(input().split()))
    if m == f == r == -1:
        break
    if m == -1 or f == -1 :
        print('F')
    elif m + f >= 80:
        print('A')
    elif 65 <= m + f < 80:
        print('B')
    elif 50 <= m + f < 65 or r >= 50:
        print('C')
    elif  m + f < 30:
        print('F')
    elif 30 <= m +f < 50 and r < 50:
        print('D')

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int, input().split(' '))
    if m == f == r == -1:
        break
    elif m == -1 or f == -1:
        print('F')
    elif m + f >= 80:
        print('A')
    elif 65 <= m + f < 80:
        print('B')
    elif 50 <= m + f < 65:
        print('C')
    elif 30 <= m + f < 50:
        if r >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
while True:
  m,f,r = map(int,input().split())
  if m == -1 and f == -1 and r == -1: exit()

  if m == -1 or  f == -1 or m + f < 30 :  print('F')
  elif m + f >= 80: print('A')
  elif m + f >= 65 and m + f < 80:  print('B')
  elif m + f >= 50 and m + f < 65:  print('C')
  elif m + f >= 30 and m + f < 50:
    if r >= 50:
      print('C')
    else:
      print('D')

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    # print(m,f,r)
    temp = m+f
    if m == f == r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif 80 <= temp:
        print("A")
    elif 65 <= temp:
        print("B")
    elif 50 <= temp:
        print("C")
    elif 30 <= temp:
        if 50 <= r:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    if m==-1 or f==-1:
        print('F')
    elif m+f >= 80:
        print('A')
    elif 65 <= m+f <=80:
        print('B')
    elif 50 <= m+f < 65 or 30 <= m+f <50 and r >= 50:
        print('C')
    elif 30 <= m+f < 50:
        print('D')
    elif 30 > m+f:
        print('F')

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int, input().split())
    
    if m==f==r==-1:
        break
    
    if m==-1 or f==-1:
        print("F")
    elif m+f>=80:
        print("A")
    elif m+f>=65:
        print("B")
    elif m+f>=50:
        print("C")
    elif m+f>=30 and r>=50:
        print("C")
    elif m+f>=30:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m,f,r = list(map(int,input().split(" ")))
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif m+f >= 80:
        print("A")
    elif m+f < 80 and m+f >= 65:
        print("B")
    elif m+f < 65 and m+f >= 50:
        print("C")
    elif m+f < 50 and m+f >= 30 and r >= 50:
        print("C")
    elif m+f < 50 and m+f >= 30 and r < 50:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
"""
中間試験と期末試験は 50 点満点（m, f ≤ 50）、再試験は 100 点満点 （r ≤ 100）
試験を受けていない場合は点数を -1

中間試験、期末試験のいずれかを欠席した場合成績は F。
中間試験と期末試験の合計点数が 80 以上ならば成績は A 。
中間試験と期末試験の合計点数が 65 以上 80 未満ならば成績は B。
中間試験と期末試験の合計点数が 50 以上 65 未満ならば成績は C。
中間試験と期末試験の合計点数が 30 以上 50 未満ならば成績は D。 ただし、再試験の点数が 50 以上ならば成績は C。
中間試験と期末試験の合計点数が 30 未満ならば成績は F
"""
while True:
    mid_test, fin_test, re_test = map(int, input().split())
    if (mid_test == -1) & (fin_test == -1) & (re_test == -1):
        break
    else:
        if (mid_test == -1) or (fin_test == -1):
            print("F")
        else:
            total_mf = mid_test + fin_test
            if total_mf >= 80:
                print("A")
            elif 65 <= total_mf < 80:
                print("B")
            elif 50 <= total_mf < 65:
                print("C")
            elif 30 <= total_mf < 50:
                if re_test >= 50:
                    print("C")
                else:
                    print("D")
            else:
                print("F")

Submission status: Accepted

Solution code:
while True:
  a,b,c=map(int,input().split())
  if a<0 and b<0 and c<0:
      break
  else:  
    if a<0 or b<0:
        print('F')
    elif a+b>=80:
        print('A')
    elif 65<=a+b<80:
        print('B')
    elif 50<=a+b<65:
        print('C')
    elif 30<=a+b<50:
        if c>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
grade = []

while 1:
    grade.append(list(map(int, input().split())))
    if grade[-1][0] == -1 and grade[-1][1] == -1 and grade[-1][2]: break

for i in range(len(grade) - 1):
    if grade[i][0] == -1 or grade[i][1] == -1:
        print('F')
    elif grade[i][0] + grade[i][1] >= 80:
        print('A')
    elif grade[i][0] + grade[i][1] >= 65:
        print('B')
    elif grade[i][0] + grade[i][1] >= 50:
        print('C')
    elif grade[i][0] + grade[i][1] >= 30 and grade[i][2] >= 50:
        print('C')
    elif grade[i][0] + grade[i][1] >= 30:
        print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
while True:
	m, f, r = map(int, input().split())
	if m == -1 and f == -1 and r == -1:
		exit()
	sum = 0
	sum = m + f
	if m == -1 or f == -1:print('F')
	elif sum >=  80:print('A')
	elif sum >= 65:print('B')
	elif sum >= 50:print('C')
	elif sum >= 30:
		if r >= 50:
			print('C')
		else:
			print('D')
	else:
		print('F')

Submission status: Accepted

Solution code:
while True:
    m,f,r = [int(x) for x in input().split()]
    if (m,f,r) == (-1,-1,-1):
        break
    if   m < 0 or f < 0: 
        print('F')
    elif m + f <  30:    
        print('F')
    elif m + f >= 80:    
        print('A')
    elif m + f >= 65:    
        print('B')
    elif m + f >= 50:    
        print('C')
    elif r    >= 50:    
        print('C')
    else:                
        print('D')

Submission status: Accepted

Solution code:
def Score(m,f,r):
    if m == -1:
        m = 0
        return "F"
    if f == -1:
        f = 0
        return "F"
    if  (m + f ) >=80:
        return "A"
    elif (m + f ) < 80 and (m + f ) >= 65:
        return "B"
    elif (m + f ) < 65 and (m + f ) >= 50:
        return "C"
    elif (m + f ) < 50 and (m + f ) >= 30:
        if r >= 50:
            return "C"
        return "D"
    elif (m + f) < 30:
        return "F"

while True:
    m, f, r = list(map(int, input().split()))
    if m == -1 and f == -1 and r == -1:
        break
    print(Score(m,f,r))

Submission status: Accepted

Solution code:
EOL = '-1 -1 -1'

def grading(m, f, r):
    score_sum = m + f

    if -1 in [m, f] or score_sum < 30:
        return 'F'
    
    if score_sum >= 80:
        return 'A'
    elif score_sum >= 65:
        return 'B'
    elif score_sum >= 50:
        return 'C'
    
    if r >= 50:
        return 'C'
        
    return 'D'
   


for line in iter(input, EOL):
    m, f, r = map(int, line.split())
    print(grading(m, f, r))

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    mf = m + f
    mfr = m + f + r

    if mfr == -3:
        break
    elif m == -1 or f == -1:
        print('F')
    elif 80 <= mf:
        print('A')
    elif 65 <= mf:
        print('B')
    elif 50 <= mf or 50 <= r:
        print('C')
    elif 30 <= mf:
        print('D')
    elif mf < 30:
        print('F')

Submission status: Accepted

Solution code:
while True:
  m, f, r = map(int, input().split())
  if m == -1 and f == -1 and r == -1:
    break
  elif m == -1 or f == -1:
    print('F')
  elif m + f >= 80:
    print('A')
  elif m + f >= 65:
    print('B')
  elif m + f >= 50:
    print('C')
  elif m + f >= 30:
    if r >= 50:
      print('C')
    else:
      print('D')
  else:
    print('F')

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1: break
    if m==-1 or f==-1: print('F')
    elif m+f>=80: print('A')
    elif m+f>=65 and m+f<80: print('B')
    elif m+f>=50 and m+f<65: print('C')
    elif m+f>=30 and m+f<50:
        if r>=50: print('C')
        else: print('D')
    elif m+f<30: print('F')

Submission status: Accepted

Solution code:
for _ in range(50):
    m, f, r = map(int, input().split())

    if (m == -1) and (f == -1) and (r == -1):
        break

    if (m == -1) or (f == -1):
        print("F")
        continue

    s = m + f

    if s >= 80:
        print("A")
    elif 80 > s >= 65:
        print("B")
    elif 65 > s >= 50:
        print("C")
    elif 50 > s >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    elif 30 > s:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = (int(x) for x in input().split())
    if m == -1 and f == -1 and r == - 1:
        break
    
    if m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f>= 65 and m + f < 80:
        print("B")
    elif m + f >= 50 and m + f < 65:
        print("C")
    elif m + f >= 30 and m + f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    elif m + f < 30:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    
    if m == -1 or f == -1:
        print('F')
    elif m+f >= 80:
        print('A')
    elif m+f >= 65 and m+f<80:
        print('B')
    elif m+f >= 50 and m+f<65:
        print('C')
    elif m+f >= 30 and m+f<50:
        if r>=50:
            print('C')
        else:
            print('D')
    elif m+f < 30:
        print('F')

Submission status: Accepted

Solution code:

while True:
    a,b,c=map(int,input().split())
    d = a+b
    
    if a == -1 and b == -1 and c == -1:
        break
    
    if a == -1 or b == -1:
        print("F")
    elif d < 30:
        print("F")
    elif d < 50:
        if c >= 50:
            print("C")
        else:
            print("D")
    elif d < 65:
        print("C")
    elif d < 80:
        print("B")
    else:
        print("A")

Submission status: Accepted

Solution code:
while True:
    f, m, r = [int(n) for n in input().split()]
    if f == m == r == -1:
        break
    if (f==-1 or m==-1) or (f+m < 30):
        ans = 'F'
    elif 30 <= f+m < 50:
        ans = 'D'
        if 50 <= r:
            ans = 'C'
    elif 50 <= f+m < 65:
        ans = 'C'
    elif 65 <= f+m < 80:
        ans = 'B'
    else:
        ans = 'A'
    print(ans)

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m+f >= 65:
        print("B")
    elif m+f >= 50:
        print("C")
    elif m+f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    elif m+f < 30:
        print("F")

Submission status: Accepted

Solution code:
for i in range(50):
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print('F')
    elif m + f >= 80:
        print('A')
    elif 80 > m + f >= 65:
        print('B')
    elif 65 > m + f >= 50:
        print('C')
    elif 50 > m + f >= 30 and r >= 50:
        print('C')
    elif 50 > m + f >= 30:
        print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
# coding: utf-8
# 66
while True:
    m,f,r = map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    G = m+f
    if m==-1 or f==-1:
        print('F')
    elif G>=80:
        print('A')
    elif G>=65 and G<80:
        print('B')
    elif G>=50 and G<65:
        print('C')
    elif G>=30 and G<50:
        if r>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
ans = []
for i in range(100000):
  m, f, r = map(int, input().split())
  mf_sum = m + f

  if m == -1 or f == -1 or mf_sum < 30:
    val = 'F'
  elif mf_sum >= 80:
    val = 'A'
  elif 65 <= mf_sum < 80:
    val = 'B'
  elif 50 <= mf_sum < 65 or (30 <= mf_sum < 50 and r >= 50):
    val = 'C'
  elif 30 <= mf_sum < 50:
    val = 'D'

  if m == -1 and f == -1 and r == -1:
    break
  ans.append(val)

[print(x) for x in ans]

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    score = m + f

    if m==-1 and f==-1 and r==-1:
        break
    elif m==-1 or f==-1:
        print("F")
    elif score>=80:
        print("A")
    elif score>=65:
        print("B")
    elif score>=50:
        print("C")
    elif score>=30:
        if r>=50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    while True:
        m, f, r = map(int, input().split())
        if m==-1 and f==-1 and r==-1:
            sys.exit()
        elif m==-1 or f==-1:
            print("F")
        else:
            if m + f >= 80:
                print("A")
            elif 65 <= m + f <80:
                print("B")
            elif 50 <= m + f <65:
                print("C")
            elif 30 <= m + f <50:
                if r >= 50 :
                    print("C")
                else:
                    print("D")
            else:
                print("F")
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
while (True):
    m, f, r = map(int, input().split())
    if (m == f == r == -1):
        break

    if (m == -1 or f == -1):
        print("F")

    elif m + f >= 80:
        print("A")

    elif m + f >= 65:
        print("B")

    elif m + f >= 50 or m+f+r >= 80:
        print("C")

    elif m+f >= 30:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
m,f,r = [],[],[]

while True:
    a,b,c=map(int,input().split())
    if (a==-1) & (b==-1) & (c==-1):
        break
    m.append(a)
    f.append(b)
    r.append(c)

for i in range(len(m)):
    judge = m[i]+f[i]
    if (m[i]<0) or (f[i]<0):
        print('F')
        continue
            
    if (judge >= 80):
        print('A')
    
    elif (judge < 80) & (judge >= 65):
        print('B')
    
    elif (judge < 65) & (judge >= 50):
        print('C')
    
    elif (judge < 50) & (judge >= 30):
        if r[i] >= 50:
            print('C')
        else:
            print('D')
        
    elif judge < 30:
        print('F')

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    if m==-1 or f==-1:
        print("F")
    elif m+f>=80:
        print("A")
    elif m+f>=65 and m+f<80:
        print("B")
    elif m+f>=50 and m+f<65:
        print("C")
    elif m+f>=30 and m+f<50:
        if r>=50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
lis=[]

while True:
	m,f,r=[int(x) for x in input().split()]
	if m==-1 and f==-1 and r==-1:
		break
	lis.append([m,f,r])

for i in lis:
	m,f,r=i[0],i[1],i[2]
	res=""
	if m==-1 or f==-1:
		res="F"
	elif 30<=m+f and m+f < 50:
		if 50<=r:
			res="C"
		else:
			res="D"
	elif 50<=m+f and m+f<65:
		res="C"
	elif 65 <= m+f < 80:
		res="B"
	elif 80<= m+f:
		res="A"
	elif m+f < 30:
		res="F"

	print(res)

Submission status: Accepted

Solution code:

def exe_grading():
    
    grade_list=[]
    
    while True:
        
        m,f,r=tuple(map(int,input().split()))

        if m==-1 and f==-1 and r ==-1:
            break
        
        
        grade_list.append((m,f,r))
        
    for m,f,r in grade_list:
        score=m+f
        if m==-1 or f ==-1:
            print("F")
        elif score>=80:
            print("A")
        elif 80>score>=65:
            print("B")
        elif 65>score>=50:
            print("C")
        elif 50>score>=30:
            if r>=50:
                print("C")
            else:
                print("D")
        else:
            print("F")
        
exe_grading()

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())

    if m==-1 and f==-1 and r==-1:
        break
    
    if m ==-1 or f == -1:
        print('F')
        
    elif m + f >=80:
        print('A')
        
    elif 65<=m+f and m+f<80:
        print('B')
    
    elif 50<=m+f and m+f<65:
        print('C')
        
    elif 30<=m+f and m+f<50:    
        if r >=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
while True :
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1 :
        break
    else :
        if m == -1 or f == -1 :
            print("F")
        elif 80 <= m+f :
            print("A")
        elif 65 <= m+f < 80 :
            print("B")
        elif 50 <= m+f < 65 :
            print("C")
        elif 30 <= m+f < 50 and 50 <= r :
            print("C")
        elif 30 <= m+f < 50 and r < 50 :
            print("D")
        elif m+f < 30 :
            print("F")

Submission status: Accepted

Solution code:

#中間テストの点数m,期末テストの試験f,再試験の点数r

while True:
    m,f,r = map(int,input().split())
    if m==f==r==-1: break

    if m==-1 or f==-1: print("F")
    elif m+f>=80: print("A")
    elif m+f>=65: print("B")
    elif m+f>=50: print("C")
    elif m+f>=30:
        if r>=50: print("C")
        else: print("D")
    elif m+f<30: print("F")

Submission status: Accepted

Solution code:
results = []
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    results.append([m, f, r, m+f])

for result in results:
    if result[0] == -1 or result[1] == -1:
        print('F')
    else:
        if result[3] >= 80:
            print('A')
        elif result[3] >= 65:
            print('B')
        elif result[3] >= 50:
            print('C')
        elif result[3] >= 30:
            if result[2] >= 50:
                print('C')
            else:
                print('D')
        else:
            print('F')

Submission status: Accepted

Solution code:
scr = []
for x in range(51):
    scr.append(list(map(int, input().split())))
    if scr[x][0] == -1 and scr[x][1] == -1 and scr[x][2] == -1:
        break
ans = []

for x in range(len(scr)-1):
    if scr[x][0] == -1 or scr[x][1] == -1:
        ans.append("F")
    elif scr[x][0] + scr[x][1] >= 80:
        ans.append("A")
    elif scr[x][0] + scr[x][1] >= 65:
        ans.append("B")
    elif scr[x][0] + scr[x][1] >= 50:
        ans.append("C")
    elif scr[x][0] + scr[x][1] >= 30 and scr[x][2] >= 50:
        ans.append("C")
    elif scr[x][0] + scr[x][1] >= 30 and scr[x][2] < 50:
        ans.append("D")
    elif scr[x][0] + scr[x][1] < 30:
        ans.append("F")

for x in range(len(ans)):
    print(ans[x])

Submission status: Accepted

Solution code:
for i in range(100):
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:
        break
    else:
        if m == -1 or f == -1:
            print("F")
        else:
            if m+f >= 80:
                print("A")
            elif 65<=m+f<80:
                print("B")
            elif 50<=m+f<65:
                print("C")
            elif 30<=m+f<50:
                if r >= 50:
                    print("C")
                else:
                    print("D")
            elif m+f < 30:
                print("F")

Submission status: Accepted

Solution code:

while True:
    m, f, r = map(int, input().split())
    if m+f+r==-3:
        break

    if m==-1 or f==-1:
        print('F')

    else:
        score=m+f
        if score>=80:
            print('A')
        elif 80> score>=65:
            print('B')
        elif 65> score>=50:
            print('C')
        elif 50>score>=30:
            if r>=50:
                print('C')
            else:
                print('D')
        else:
            print('F')

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int, input().split())
    if (m==-1)&(f==-1)&(r==-1): break
    if (m==-1)|(f==-1):
        ans = 'F'
    elif m+f>=80:
        ans = 'A'
    elif m+f>=65:
        ans = 'B'
    elif m+f>=50:
        ans = 'C'
    elif m+f>=30:
        ans = 'D'
        if r>=50:
            ans = 'C'
    else:
        ans = 'F'
    print(ans)

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    else:
        sum1=m+f
        if m==-1 or f==-1:
            print("F")
        else:
            if 80<=sum1:
                print("A")
            if 65<=sum1<80:
                print("B")
            if 50<=sum1<65:
                print("C")
            if 30<=sum1<50:
                if r>=50:
                    print("C")
                else:
                    print("D")
            if sum1<30:
                print("F")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True:
   m, f, r = map(int, input().split())
   if m == -1 and f == -1 and r == -1:
      break
   
   if m == -1 or f == -1 or m + f < 30:
      print("F")
   elif m + f >= 80:
      print("A")
   elif m + f >= 65 and m + f < 80:
      print("B")
   elif m + f >= 50 and m + f < 65:
      print("C")
   else:
      if r >= 50:
         print("C")
      else:
         print("D")

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    if m == -1 or f == -1:
        print('F')
    elif m + f >= 80:
        print('A')
    elif 80 > m + f >= 65:
        print('B')
    elif 65 > m + f >= 50:
        print('C')
    elif 50 > m + f >= 30:
        if r >= 50:
            print('C')
        else:
            print('D')
    elif 30 > m + f:
        print('F')

Submission status: Accepted

Solution code:
for e in iter(input, "-1 -1 -1"):
    
    m,f,r=map(int, e.split())

    result = ""

    if m == -1 or f == -1:
        result = "F"
    elif m + f >= 80:
        result = "A"
    elif m + f >= 65:
        result = "B"
    elif m + f >= 50:
        result = "C"
    elif m + f >= 30:
        if r >= 50:
            result = "C"
        else:
            result = "D"
    else:
        result = "F"
    
    print(result)

Submission status: Accepted

Solution code:
while True:
    M, F, R = map(int, input().split())
    if M == -1 and F == -1 and R == -1:
        break
    if M == -1 or F == -1:
        print("F")
    elif M + F >= 80:
        print("A")
    elif M + F >= 65:
        print("B")
    elif M + F >= 50:
        print("C")
    elif M + F >= 30:
        if R >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:

    m, f, r = map(int, input().split())

    if m == -1 and f == -1:
        break

    elif m == -1 or f == -1:
        print('F')

    elif m + f >= 80:
        print('A')

    elif m + f < 80 and m + f >= 65:
        print('B')

    elif m + f < 65 and m + f >=50 or r >= 50:
        print('C')

    elif m + f < 50 and m + f >= 30:
        print('D')

    elif m + f < 30:
        print('F')

Submission status: Accepted

Solution code:
def judge(m = -1, f = -1, r = -1):
    result = ""
    if m == -1 or f == -1:
        result = 'F'
    elif m + f >= 80:
        result = 'A'
    elif m + f >= 65:
        result = 'B'
    elif m + f >= 50:
        result = 'C'
    elif m + f >= 30:
        if r >= 50:
            result = 'C'
        else:
            result = 'D'
    else:
        result ='F'
    return result

while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    print(judge(m, f, r))

Submission status: Accepted

Solution code:
while True :
    m, f, r = map(int, input().split())
    m, f <= 50
    r <= 100
    s = m + f
    if m == -1 and f == -1 and r == -1 :
        break
    if m == -1 or f == -1 :
        print("F")
    elif 80 <= s :
        print("A")
    elif 65 <= s < 80 :
        print("B")
    elif 50 <= s < 65 :
        print("C")
    elif 30 <= s < 50 :
        if 50 <= r :
            print("C")
        else :
            print("D")
    else :
        print("F")