Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BonusScoringSystem
- {
- class Program
- {
- static void Main(string[] args)
- {
- int students = int.Parse(Console.ReadLine());
- int lectures = int.Parse(Console.ReadLine());
- int bonus = int.Parse(Console.ReadLine());
- int[] attendances = new int[students];
- for (int i = 0; i < students; i++)
- {
- attendances[i] = int.Parse(Console.ReadLine());
- }
- int maxBonus = (int)(lectures > 0 ? Math.Ceiling(1.0 * attendances.Max() / lectures * (5 + bonus)) : 0);
- Console.WriteLine($"Max Bonus: {maxBonus}.\nThe student has attended {(attendances.Sum() > 0 ? attendances.Max() : 0)} lectures.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement