Advertisement
Guest User

Untitled

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