Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Divide_without_remainder
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countNum = int.Parse(Console.ReadLine());
- double Counter2 = 0;
- double Counter3 = 0;
- double Counter4 = 0;
- for (int i = 1; i <= countNum; i++)
- {
- double Num = double.Parse(Console.ReadLine());
- if(Num%2==0)
- {
- Counter2++;
- }
- if (Num % 3 == 0)
- {
- Counter3++;
- }
- if (Num % 4 == 0)
- {
- Counter4++;
- }
- }
- double Procent2 = Counter2 * 100 / countNum;
- double Procent3 = Counter3 * 100 / countNum;
- double Procent4 = Counter4 * 100 / countNum;
- Console.WriteLine($"{Procent2:f2}%");
- Console.WriteLine($"{Procent3:f2}%");
- Console.WriteLine($"{Procent4:f2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment