Advertisement
anizko

09. Spice Must Flow

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