Advertisement
spasnikolov131

Untitled

Mar 24th, 2022
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. using System;
  2. using static System.Console;
  3.  
  4. namespace The_begining
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11. var divisibleBy2 = 0;
  12. var divisibleBy3 = 0;
  13. var divisibleBy4 = 0;
  14. var p1 = 0;
  15. for (int i = 0; i < n; i++)
  16. {
  17. int numbers = int.Parse(Console.ReadLine());
  18.  
  19. if (numbers % 2 == 0)
  20. {
  21.  
  22. divisibleBy2++;
  23. p1 = (divisibleBy2 / 10) * 100;
  24.  
  25. }
  26. if (numbers % 3 == 0)
  27. {
  28. divisibleBy3++;
  29.  
  30.  
  31. }
  32. if (numbers % 4 == 0)
  33. {
  34. divisibleBy4++;
  35.  
  36.  
  37. }
  38. }
  39. Console.WriteLine(p1);
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement