Last active
August 29, 2015 14:03
-
-
Save MuoTK/4e05472c1b17271f58db to your computer and use it in GitHub Desktop.
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
using System; | |
namespace test01 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
while (true) | |
{ | |
string str = Console.ReadLine(); | |
string[] ArryNum = str.Split(); | |
int em = int.Parse(ArryNum[0]); //中間試験 | |
int te = int.Parse(ArryNum[1]); //期末試験 | |
int re = int.Parse(ArryNum[2]); //再試験 | |
int sum = em + te; | |
if (em == -1 && te == -1 && re == -1) | |
{ | |
break; | |
} | |
else if (sum < 30 || em == -1 || te == -1) | |
{ | |
Console.WriteLine("F"); | |
} | |
else if (sum >= 80) | |
{ | |
Console.WriteLine("A"); | |
} | |
else if (sum >= 65) | |
{ | |
Console.WriteLine("B"); | |
} | |
else if (sum >= 50) | |
{ | |
Console.WriteLine("C"); | |
} | |
else | |
{ | |
if (re >= 50) | |
{ | |
Console.WriteLine("C"); | |
} | |
else | |
{ | |
Console.WriteLine("D"); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment