Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Train_The_Trainers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int people = int.Parse(Console.ReadLine());
- double score = 0;
- double counter = 0;
- while (true)
- {
- string presentation = Console.ReadLine();
- double sumOfGrades = 0;
- if (presentation == "Finish")
- {
- double scoreSum = score / counter;
- Console.WriteLine($"Student's final assessment is {scoreSum:f2}.");
- break;
- }
- for (int i = 0; i < people; i++)
- {
- double grade = double.Parse(Console.ReadLine());
- sumOfGrades += grade;
- score += grade;
- counter++;
- }
- double sumAfter = sumOfGrades / people;
- Console.WriteLine($"{presentation} - {sumAfter:f2}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement