Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Division
- {
- class Program
- {
- static void Main(string[] args)
- {
- var p1 = 0.0;
- var p2 = 0.0;
- var p3 = 0.0;
- var n = int.Parse(Console.ReadLine());
- for (int i = 1; i <= n; i++)
- {
- var num = int.Parse(Console.ReadLine());
- if (num % 2==0)
- {
- p1++;
- }
- if (num % 3 == 0)
- {
- p2++;
- }
- if (num % 4 == 0)
- {
- p3++;
- }
- }
- var percent1 = p1 / n * 100;
- var percent2 = p2 / n * 100;
- var percent3 = p3 / n * 100;
- Console.WriteLine($"{percent1:f2}%");
- Console.WriteLine($"{percent2:f2}%");
- Console.WriteLine($"{percent3:f2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement