Teo_Yanchev

02. DataTypes - SpiceMustFlow - C# Fundamentals

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