Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp125
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = double.Parse(Console.ReadLine());
- var p2 = 0;
- var p3 = 0;
- var p4 = 0;
- var p5 = 0;
- var p6 = 0;
- for (int i = 0; i < n; i++)
- {
- var tochki = double.Parse(Console.ReadLine());
- if (tochki >= 0 && tochki <= 22.5)
- {
- p2++;
- }
- else if (tochki > 22.5 && tochki <= 40.5)
- {
- p3++;
- }
- else if (tochki > 40.5 && tochki <= 58.5)
- {
- p4++;
- }
- else if (tochki > 58.5 && tochki <= 76.5)
- {
- p5++;
- }
- else if (tochki > 76.5 && tochki <= 100)
- {
- p6++;
- }
- }
- var slab = (p2 / n) * 100.0;
- var sreden = (p3 / n) * 100.0;
- var dobur = (p4 / n) * 100.0;
- var mndobur = (p5 / n) * 100.0;
- var otlichen = (p6 / n) * 100.0;
- Console.WriteLine("{0:f2}% poor marks", slab);
- Console.WriteLine("{0:f2}% satisfactory marks", sreden);
- Console.WriteLine("{0:f2}% good marks", dobur);
- Console.WriteLine("{0:f2}% very good marks", mndobur);
- Console.WriteLine("{0:f2}% excellent marks", otlichen);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement