Advertisement
Teo_Yanchev

Spice must flow -C# - Fundamental

Aug 19th, 2020
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _09.Mining
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int startingYield = int.Parse(Console.ReadLine());
  10.  
  11. int days = 0;
  12. int spice = 0;
  13. int realSpice = 0;
  14. while (startingYield >= 100)
  15. {
  16. spice = startingYield;
  17. days += 1;
  18. spice -= 26;
  19. realSpice += spice;
  20. startingYield -= 10;
  21. }
  22. if (realSpice >= 26)
  23. {
  24. realSpice -= 26;
  25. }
  26. Console.WriteLine(days);
  27. Console.WriteLine(realSpice);
  28. }
  29. }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement