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