Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Modular_division
- {
- class Program
- {
- static void Main(string[] args)
- {
- double N = double.Parse(Console.ReadLine());
- double input = 0.0;
- int p1 = 0;
- int p2 = 0;
- int p3 = 0;
- for (int i = 0; i < N; i++)
- {
- input = double.Parse(Console.ReadLine());
- if (input % 2 == 0)
- {
- p1++;
- }
- if (input % 3 == 0)
- {
- p2++;
- }
- if (input % 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