Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CodingExam
- {
- class Program
- {
- static void Main()
- {
- var n = float.Parse(Console.ReadLine());
- short count2, count3, count4;
- count2 = count3 = count4 = 0;
- for (int i = 0; i < n; i++)
- {
- var num = short.Parse(Console.ReadLine());
- if (num % 2 == 0) count2++;
- if (num % 3 == 0) count3++;
- if (num % 4 == 0) count4++;
- }
- Console.WriteLine("{0:f2}%", count2 / n * 100);
- Console.WriteLine("{0:f2}%", count3 / n * 100);
- Console.WriteLine("{0:f2}%", count4 / n * 100);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement