Advertisement
desislava_topuzakova

01. Vet Clinic

Mar 17th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. namespace _01._Vet_Clinic;
  2. class Program
  3. {
  4. static void Main(string[] args)
  5. {
  6. int count = int.Parse(Console.ReadLine()); //брой артикули
  7.  
  8. // цикъл
  9. // for цикъл - знаем колко пъти ще повторим дадено действие
  10. // while цикъл - не знаем колко точно пъти ще се повтори дадено действие
  11.  
  12. int totalSum = 0; //обща сума за всички артикули
  13. for (int item = 1; item <= count; item++)
  14. {
  15. string type = Console.ReadLine();
  16. //microscope, scalpel, syringe
  17.  
  18. if (type == "microscope")
  19. {
  20. //купуваме микроскоп
  21. totalSum = totalSum + 6000;
  22. //totalSum += 6000;
  23. }
  24. else if (type == "scalpel")
  25. {
  26. //купуваме скалпел
  27. totalSum += 1500;
  28. }
  29. else if (type == "syringe")
  30. {
  31. //купуваме спринцовка
  32. totalSum += 100;
  33. }
  34. }
  35.  
  36. Console.WriteLine($"{totalSum:F2}");
  37.  
  38.  
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement