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.Security.Cryptography.X509Certificates;
- using System.Text;
- using System.Threading.Tasks;
- namespace _05
- {
- class Program
- {
- static void Main(string[] args)
- {
- //налични подаръци: lego, monopoly, puzzle, robot
- int countKids = int.Parse(Console.ReadLine()); //брой деца
- int countLego = 0; //брой на лего
- int countMonopoly = 0; //брой на монополи
- int countPuzzle = 0; //брой на пъзели
- int countRobot = 0; //брой на роботи
- for (int kid = 1; kid <= countKids; kid++)
- {
- string present = Console.ReadLine(); //поръчан подарък
- switch (present)
- {
- case "lego":
- countLego++;
- break;
- case "monopoly":
- countMonopoly++;
- break;
- case "puzzle":
- countPuzzle++;
- break;
- case "robot":
- countRobot++;
- break;
- }
- }
- Console.WriteLine($"Lego: {countLego}");
- Console.WriteLine($"Monopoly: {countMonopoly}");
- Console.WriteLine($"Puzzles: {countPuzzle}");
- Console.WriteLine($"Robots: {countRobot}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement