Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Runtime.Remoting.Channels;
- namespace ConsoleApplication
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- var n = decimal.Parse(Console.ReadLine());
- var topStudentCounter = 0;
- var goodCounter = 0;
- var almostCounter = 0;
- var fail = 0;
- decimal x = 0;
- for (int i = 0; i < n; i++)
- {
- decimal grade = decimal.Parse(Console.ReadLine());
- x += grade;
- if (grade >= (decimal) 5.00)
- {
- topStudentCounter++;
- }
- else if (grade >= (decimal) 4.00 && grade <= (decimal) 4.99)
- {
- goodCounter++;
- }
- else if (grade >= (decimal) 3.00 && grade <= (decimal) 3.99)
- {
- almostCounter++;
- }
- else
- {
- fail++;
- }
- }
- Console.WriteLine("Top students: {0:f2}%",(100/n)*topStudentCounter);
- Console.WriteLine("Between 4.00 and 4.99: {0:f2}%",(100/n)*goodCounter);
- Console.WriteLine("Between 3.00 and 3.99: {0:f2}%",(100/n)*almostCounter);
- Console.WriteLine("Fail: {0:f2}%",(100/n)*fail);
- Console.WriteLine("Average: {0:f2}",x/n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement