Skip to content

Instantly share code, notes, and snippets.

@MuoTK
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MuoTK/4e05472c1b17271f58db to your computer and use it in GitHub Desktop.
Save MuoTK/4e05472c1b17271f58db to your computer and use it in GitHub Desktop.
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