SHARE
TWEET

09. Spice Must Flow

anizko May 26th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top