Submission #18783


Source Code Expand

Copy
        static void Main(string[] args)
        {
            int numOfA = CountChar(args[0], 'A');
            int numOfB = CountChar(args[0], 'B');
            int numOfC = CountChar(args[0], 'C');
            int numOfD = CountChar(args[0], 'D');
            int numOfF = CountChar(args[0], 'F');

            double gpa = (numOfA * 4.0f + numOfB * 3.0f + numOfC * 2.0f + numOfD * 1.0f) / args[0].Length;
            Console.WriteLine(gpa.ToString());
        }

        public static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }

Submission Info

Submission Time
Task A - GPA計算
User jack1568
Language C# (Mono 2.10.8.1)
Score 0
Code Size 620 Byte
Status CE

Compile Error

./Main.cs(1,15): error CS1525: Unexpected symbol `void', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
./Main.cs(16,9): error CS8025: Parsing error