Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = int.Parse(Console.ReadLine());
- double p1 = 0;
- double p2 = 0;
- double p3 = 0;
- double p4 = 0;
- double p5 = 0;
- for (int i = 1; i < n; i++)
- {
- int curentNum = int.Parse(Console.ReadLine());
- if (n < 200)
- {
- p1++;
- }
- else if (n < 400)
- {
- p2++;
- }
- else if (n < 600)
- {
- p3++;
- }
- else if (n < 800)
- {
- p4++;
- }
- else if (n >= 800)
- {
- p5++;
- }
- }
- Console.WriteLine($"{p1 / n * 100:f2}%");
- Console.WriteLine($"{p2 / n * 100:f2}%");
- Console.WriteLine($"{p3 / n * 100:f2}%");
- Console.WriteLine($"{p4 / n * 100:f2}%");
- Console.WriteLine($"{p5 / n * 100:f2}%");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement