Advertisement
desislava_topuzakova

Untitled

Dec 4th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp2
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int countKids = int.Parse(Console.ReadLine());
  10.  
  11. int countLego = 0;
  12. int countMonopoly = 0;
  13. int countRobot = 0;
  14. int countPuzzle = 0;
  15.  
  16. for (int kid = 1; kid <= countKids; kid++)
  17. {
  18. string present = Console.ReadLine();
  19.  
  20. switch (present)
  21. {
  22. case "lego":
  23.  
  24. countLego++;
  25. break;
  26. case "monopoly":
  27. countMonopoly++;
  28. break;
  29. case "robot":
  30. countRobot++;
  31. break;
  32. case "puzzle":
  33. countPuzzle++;
  34. break;
  35. }
  36. }
  37. Console.WriteLine("Lego:" + countLego);
  38. Console.WriteLine("Monopoly:" + countMonopoly);
  39. Console.WriteLine("Robots:" + countRobot);
  40. Console.WriteLine("Puzzles:" + countPuzzle);
  41.  
  42. }
  43.  
  44.  
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement