Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _01._Vet_Clinic;
- class Program
- {
- static void Main(string[] args)
- {
- int count = int.Parse(Console.ReadLine()); //брой артикули
- // цикъл
- // for цикъл - знаем колко пъти ще повторим дадено действие
- // while цикъл - не знаем колко точно пъти ще се повтори дадено действие
- int totalSum = 0; //обща сума за всички артикули
- for (int item = 1; item <= count; item++)
- {
- string type = Console.ReadLine();
- //microscope, scalpel, syringe
- if (type == "microscope")
- {
- //купуваме микроскоп
- totalSum = totalSum + 6000;
- //totalSum += 6000;
- }
- else if (type == "scalpel")
- {
- //купуваме скалпел
- totalSum += 1500;
- }
- else if (type == "syringe")
- {
- //купуваме спринцовка
- totalSum += 100;
- }
- }
- Console.WriteLine($"{totalSum:F2}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement