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:
while True:
    m, f, r = map(int, input().split())
    if m==-1 and f==-1 and r==-1:break
    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:
m, f, r = map(int, input().split())
g = []
while m != -1 or f != -1 or r != -1:
    s = m + f
    if m == -1 or f == -1:
        g.append("F")
    elif s >= 80:
        g.append("A")
    elif 80 > s >= 65:
        g.append("B")
    elif 65 > s >= 50:
        g.append("C")
    elif 50 > s >= 30:
        if r >= 50:
            g.append("C")
        else:
            g.append("D")
    else:
        g.append("F")
    m, f, r = map(int, input().split())

for p in g:
    print(p)

Submission status: Accepted

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

    elif m == -1 or r == -1:
        list.append("F")

    elif m+r >= 80:
        list.append("A")

    elif 65 <= m+r < 80:
        list.append("B")

    elif 50 <= m+r < 65:
            list.append("C")

    elif 30 <= m+r < 50:
        if f >= 50:
            list.append("C")
        else:
            list.append("D")

    elif  m+r < 30:
            list.append("F")

[print(i) for i in list]

Submission status: Accepted

Solution code:

M = []
F = []
R = []
grade = []
m = 0; f = 0; r = 0
while 1:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    M.append(m)
    F.append(f)
    R.append(r)


for i in range(len(M)):
    if M[i] == -1 or F[i] == -1 or M[i] + F[i] < 30:
        print('F')
    elif M[i] + F[i] >= 80:
        print('A')
    elif 65 <= M[i] + F[i] < 80:
        print('B')
    elif 50 <=  M[i] + F[i] < 65:
        print('C')
    elif 30 <= M[i] + F[i] < 50:
        if R[i] >= 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
    total=m+f
    if(m==-1 or f==-1):
        print("F")
    elif(total>=80):
        print("A")
    elif(total>=65):
        print("B")
    elif(total>=50):
        print("C")
    elif(total>=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
    result = "A" if m+f >= 80 else "B" if 80 > m+f >= 65 else "C" if 65 > m+f >= 50 or r >= 50 else "D" if 50 > m+f >= 30 else "F"
    if m == -1 or f == -1:
        result = "F"

    print(result)

Submission status: Accepted

Solution code:
seiseki = []
seisekid = {1:"F",2:"D",3:"C",4:"B",5:"A"}
while True:
    x,y,z = input().split(" ")
    x = int(x)
    y = int(y)
    z = int(z)
    q = x + y + z
    i = x + y
    if q == -3:
        for t in range(len(seiseki)):
            r = t - 1
            print(seisekid[seiseki[t]])
        break
    elif x == -1:
        seiseki.append(1)
        continue
    elif y == -1:
        seiseki.append(1)
        continue
    elif i < 30:
        seiseki.append(1)
        continue
    elif i >= 30:
        if i >= 50:
            if i >= 65:
                if i >= 80:
                    seiseki.append(5)
                    continue
                else:
                    seiseki.append(4)
                    continue
            else:
                seiseki.append(3)
                continue
        elif z >= 50:
            seiseki.append(3)
            continue
        else:
            seiseki.append(2)
            continue
    else:
        seiseki.append(1)

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 or r >= 50:
        print('C')
    elif m + f >= 30:
        print('D')
    else:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

while True :
  m,f,e = map(int, input().split())
  if m == -1 and f == -1 and e == -1 :
    break
  
  t = m + f
  if m == -1 or f == -1 :
    print("F")
    continue

  if t >= 80 :
    print("A")
  elif t >= 65 and t < 80 :
    print("B")
  elif t >= 50 and t < 65 :
    print("C")
  elif t >= 30 and t < 50 :
    if e >= 50 :
      print("C")
    else:
      print("D")
  else :
    print("F")

Submission status: Accepted

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

while m + f + r != -3 :

    if m * f < 0 :
        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")

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

Submission status: Accepted

Solution code:
result = list()
while(True):
    score = list(map(int,input().split()))

    if sum(score) == -3:
        break
    if score[0] == -1 or score[1] == -1:
        result.append("F")
    elif score[0]+score[1] >= 80:
        result.append("A")
    elif score[0]+score[1] >= 65:
        result.append("B")
    elif score[0]+score[1] >= 50:
        result.append("C")
    elif score[0]+score[1] >= 30:
        if score[2] >= 50:
            result.append("C")
        else:
            result.append("D")
    else:
        result.append("F")
for i in range(len(result)):
    print(result[i])

Submission status: Accepted

Solution code:
list_MFR = list()
while True:
    base = input()
    term = base.split(' ')
    if(int(term[0]) == -1 and int(term[1]) == -1 and int(term[2]) == -1):
        break
    else:
        map_MFR = {'M': int(term[0]), 'F': int(term[1]), 'R': int(term[2])}
        list_MFR.append(map_MFR)

for s in list_MFR:
    if s['M'] == -1 or s['F'] == -1:
        print('F')
    elif s['M'] + s['F'] >= 80:
        print('A')
    elif s['M'] + s['F'] >= 65 and s['M'] + s['F'] < 80:
        print('B')
    elif s['M'] + s['F'] >= 50 and s['M'] + s['F'] < 65:
        print('C')
    elif s['M'] + s['F'] >= 30 and s['M'] + s['F'] < 50:
        if s['R'] >= 50:
            print('C')
        else:
            print('D')
    elif s['M'] + s['F'] < 30:
        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 80 <= m + f:
        print('A')
    elif 65 <= m + f < 80:
        print('B')
    elif 50 <= m + f < 65:
        print('C')
    elif 30 <= m + f < 50:
        if 50 <= r:
            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
    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,r,f = map(int, input().split()) 
    result = ''
    if m == -1 and r == -1 and f == -1:
        break
    if m == -1 or r == -1:
        result = 'F'
    elif m + r >= 80:
        result = 'A'
    elif  m + r >= 65 and m + r < 80:
        result = 'B'
    elif  m + r >= 50 and m + r < 65:
        result = 'C'
    elif  m + r >= 30 and m + r < 50:
        if f >= 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 == f == r == -1:
        break
    elif 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:
        if 50 <= r:
            print("C")
        else:
            print("D")
    elif m + f < 30:
        print("F")
    else:
        pass

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
while True:
    line = list(map(int,input().split()))
    m = line[0]
    r = line[1]
    f = line[2]
    
    if m==-1and r==-1 and m==-1:
        break
    
    elif m ==-1 or r == -1:
        print("F")
    elif (m+r)>=80:
        print("A")
    elif m+r >= 65 and m+r< 80:
        print("B")
    elif m+r >=50 and m+r <65:
        print("C")
    elif m+r >=30 and m+r <50 and f>=50:
        print("C")
    elif  m+r >=30 and m+r <50:
        print("D")
    elif m+r <30:
        print("F")

Submission status: Accepted

Solution code:
G = ["A","B","C","D","F"]
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 and r >= 50:
        print("C")
    elif m+f>=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:
		break
	if m == -1 and f != -1:
		print("F")
		continue
	if m != -1 and f == -1:
		print("F")
		continue
	result = m + f
	if result >= 80:
		print("A")
	elif result >= 65 and result < 80:
		print("B")
	elif result >= 50 and result < 65:
		print("C")
	elif result >= 30 and result < 50:
		if r >= 50:
			print("C")
		else:
			print("D")
	else:
		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
    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
    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
    
    else:
        if m == -1 or f == -1:
            print("F")
        else:    
            s = m+f
            if s >= 80:
                print("A")
            elif s>=65:
                print("B")
            elif s>=50:
                print("C")
            elif s>=30:
                if r >= 50:
                    print("C")
                else:
                    print("D")

            else:
                print("F")

Submission status: Accepted

Solution code:
res = []
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): res.append("F")
    elif (m + f >= 80): res.append("A")
    elif (m + f >= 65): res.append("B")
    elif (m + f >= 50): res.append("C")
    elif (r >= 50): res.append("C")
    elif (m + f >= 30): res.append("D")
    else: res.append("F")

for result in res:
    print(result)

Submission status: Accepted

Solution code:
def evaluate_mark(scores):
    if scores[0] == -1 or scores[1] == -1:
        return 'F'

    total = scores[0] + scores[1]

    if 80 <= total:
        return 'A'
    elif 65 <= total < 80:
        return 'B'
    elif 50 <= total < 65:
        return 'C'
    elif 30 <= total < 50:
        if 50 <= scores[2]:
            return 'C'
        else:
            return 'D'
    else:
        return 'F'


if __name__ == "__main__":
    student_score_list = []

    absence_code = -1

    while True:
        score_input = input()

        scores = list(map(int, score_input.split()))

        if all(map(lambda score: score == -1, scores)):
            break

        student_score_list.append(scores)

    marks = list(map(evaluate_mark, student_score_list))

    for mark in marks:
        print(mark)

Submission status: Accepted

Solution code:
student = []

for _ in range(50):
    m, f, r = list(map(int, input().split()))
    if m == -1 and f == -1 and r == -1:
        break
    student.append([m, f, r])

for i in range(len(student)):
    if student[i][0] == -1 or student[i][1] == -1:
        print("F")
        continue

    sum_stu = student[i][0] + student[i][1]
    if sum_stu >= 80:
        print("A")
    elif 80 > sum_stu >= 65:
        print("B")
    elif 65 > sum_stu >= 50:
        print("C")
    elif 50 > sum_stu >= 30:
        if student[i][2] >= 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:
        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())
    s = m + f
    if m == f == r == -1:break
    if m == -1 or f == -1:
        score = "F"
    elif s >= 80:
        score = "A"
    elif 65 <= s <80:
        score = "B"
    elif 50 <= s < 65:
        score = "C"
    elif 30 <= s < 50 and r >= 50:
        score = "C"
    elif 30 <= s < 50:
        score = "D"
    else:
        score = "F"
    print(score)

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 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 r >= 50: print('C')
    elif 30 <= m + f < 50: 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 == -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 and r <50:
        print('D')
    elif 30 <= m+f < 50 and r >= 50:
        print('C')
    elif m+f < 30:
        print('F')

Submission status: Accepted

Solution code:
import sys
import math
i=0
while i<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(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')
    i=i+1

Submission status: Accepted

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

    sum = m + f
    if m == -1 or f == -1:
        print('F')
    elif sum >= 80:
        print('A')
    elif sum >=65:
        print('B')
    elif sum >= 50 or r >= 50:
        print('C')
    elif sum >= 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:
    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:
    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 == f == r == -1:
        break
    elif m == -1 or f == -1:
        print('F')
        continue
    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')

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    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 = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif 80 <= m + f:
        print("A")
    elif 65 <= m + f <= 79:
        print("B")
    elif 50 <= m + f <= 64:
        print("C")
    elif 30 > m + f:
        print("F")
    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 == -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())
    total = m + f
    if m == -1 and f == -1 and r == -1:
        break

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

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

Submission status: Accepted

Solution code:
out = []

for _ in range(50):
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    if -1 in (m, f):
        out.append("F")
    elif 80 <= m + f:
        out.append("A")
    elif 65 <= m + f < 80:
        out.append("B")
    elif 50 <= m + f < 65:
        out.append("C")
    elif 30 <= m + f < 50:
        out.append("C" if 50 <= r else "D")
    else:
        out.append("F")

print(*out, sep="\n")

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=input().split()
    m,f,r=[int(m),int(f),int(r)]
    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 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:
        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:
    n=list(map(int,input().split()))
    if n[0]==-1 and n[1]==-1 and n[2]==-1:
        break
    elif n[0]==-1 or n[1]==-1:
        print("F")
    elif n[0]+n[1]>=80:
        print("A")
    elif 80>n[0]+n[1]>=65:
        print("B")
    elif 65>n[0]+n[1]>=50:
        print("C")
    elif 30>n[0]+n[1]:
        print("F")
    elif 50>n[0]+n[1]>=30:
        if n[2]>=50:
            print("C")
        else:
            print("D")

Submission status: Accepted

Solution code:
score = []

while True:
    m, f, r = map(int, input().split())
    total = m + f
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        score.append("F")
    elif total >= 80:
        score.append("A")
    elif total >= 65:
        score.append("B")
    elif total >= 50 or (r >= 50 and total >=30):
        score.append("C")
    elif total >= 30:
        score.append("D")
    else:
        score.append("F")
        
for i in range(len(score)):
    print(score[i])

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 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
	p = m + f
	if -1 in [m, f]:
		print('F')
	elif p >= 80:
		print('A')
	elif p < 80 and p >= 65:
		print('B')
	elif p >= 50 and p < 65:
		print('C')
	elif p >= 30 and p < 50:
		print('C' if r >= 50 else 'D')
	elif p < 30:
		print('F')

Submission status: Accepted

Solution code:
score_list = []
count = 0
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:
        score_list.append('F')
    elif m + f >= 80:
        score_list.append('A')
    elif m + f >= 65:
        score_list.append('B')
    elif m + f >= 50:
        score_list.append('C')
    elif m + f >= 30:
        if r >= 50:
            score_list.append('C')
        else:
            score_list.append('D')
    else:
        score_list.append('F')
    count+=1

for i in range(count):
    print(score_list[i])

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for e in iter(input, "-1 -1 -1"):
    m, f, r = tuple(map(int, e.split(" ")))
    total = m + f
    if -1 in (m, f):
        print("F")
    elif total >= 80:
        print("A")
    elif 80 > total >= 65:
        print("B")
    elif 65 > total >= 50:
        print("C")
    elif 50 > total >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    elif total < 30:
        print("F")

Submission status: Accepted

Solution code:
def judge(a,b):
    if a+b>=80:
        print("A")
    if 65<=a+b<80:
        print("B")
    if 50<=a+b<65:
        print("C")
    if 30<=a+b<50 and c<50:
        print("D")
    if 30<=a+b<50 and c>=50:
        print("C")
    if a+b<30:
        print("F")

while True:
    a,b,c=map(int, input().split())
    if a==b==c==-1:
        break
    if a==-1 or b==-1:
        print("F")
    if a!=-1 and b!=-1:
        judge(a,b)

Submission status: Accepted

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


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:
        print("C")
        
    elif m + f >= 30 and r >= 50:
        print("C")
        
    elif m + f >= 30 and r < 50:
        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:
        print ("F")
    elif 80 <= m+f:
        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 50 <= r:
            print ("C")
        else:
            print ("D")
    else:
        print ("F")

Submission status: Accepted

Solution code:
a = []
for i in iter(input, '-1 -1 -1'):
    a.append(list(map(int, i.split())))
for i in range(len(a)):
    if (a[i][0] == -1) | (a[i][1] == -1):
        print('F')
    elif a[i][0]+a[i][1] >= 80:
        print('A')
    elif 65 <= a[i][0]+a[i][1] < 80:
        print('B')
    elif (50 <= a[i][0]+a[i][1] < 65) | ((30 <= a[i][0]+a[i][1] < 50) & (a[i][2] >= 50)):
        print('C')
    elif 30 <= a[i][0]+a[i][1] < 50:
        print('D')
    else:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:	
	a,b,c=map(int,input().split())
	if a==-1 and b==-1 and c==-1:
		break
	if	a==-1 or b==-1:
		print("F")
	elif a+b >= 80:
		print("A")
	elif a+b >= 65:
		print("B")
	elif a+b >= 50  or c >=50:
		print("C")
	elif a+b >= 30:
		print("D")
	elif a+b < 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:
        exit()
        
    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 = (int(i) for i in input().split())
    # 終了判定
    if m==-1 & f==-1 & 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:
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')
    if m != -1 and f!=-1:
        if m+f >= 80:
            print('A')
        elif 65<=m+f<80:
            print('B')
        elif 50 <= m+f < 65 or r>=50:
            print('C')
        elif 30 <= m+f <50:
            print('D')
        elif m+f<30:
            print('F')