Advertisement
VickSuna

Untitled

Jul 10th, 2021
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ivka
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int biscuitPerDayPerWorker = int.Parse(Console.ReadLine());
  10. int numWorkers = int.Parse(Console.ReadLine());
  11. int otherFactoryBiscuits = int.Parse(Console.ReadLine());
  12.  
  13. double totalBiscuit = 0;
  14.  
  15. for (int i = 1; i <= 30; i++)
  16. {
  17. if (i % 3 == 0)
  18. {
  19. totalBiscuit += Math.Floor((biscuitPerDayPerWorker * numWorkers) * 0.75);
  20. }
  21. else
  22. {
  23. totalBiscuit += biscuitPerDayPerWorker * numWorkers;
  24. }
  25.  
  26. }
  27.  
  28. Console.WriteLine($"You have produced {totalBiscuit} biscuits for the past month.");
  29.  
  30. double percentage = Math.Abs((totalBiscuit - otherFactoryBiscuits) / otherFactoryBiscuits) * 100;
  31.  
  32. if (totalBiscuit > otherFactoryBiscuits)
  33. {
  34. Console.WriteLine($"You produce {percentage:f2} percent more biscuits.");
  35. }
  36. else
  37. {
  38. Console.WriteLine($"You produce {percentage:f2} percent less biscuits.");
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement