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 ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- double broy = 0;
- double broy1 = 0;
- double broy2 = 0;
- double broy3 = 0;
- double broy4 = 0;
- double broy5 = 0;
- for (int i = 1; i <= n; i++)
- {
- int num = int.Parse(Console.ReadLine());
- broy++;
- if (num < 200) broy1++;
- if (num >= 200 && num < 400) broy2++;
- if (num >= 400 && num < 600) broy3++;
- if (num >= 600 && num < 800) broy4++;
- if (num >= 800) broy5++;
- }
- Console.WriteLine("{0:0.00}%", 100 * broy1 / broy);
- Console.WriteLine("{0:0.00}%", 100 * broy2 / broy);
- Console.WriteLine("{0:0.00}%", 100 * broy3 / broy);
- Console.WriteLine("{0:0.00}%", 100 * broy4 / broy);
- Console.WriteLine("{0:0.00}%", 100 * broy5 / broy);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment