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