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