anizko

9. *Spice Must Flow

May 25th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 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.             int startingYield = int.Parse(Console.ReadLine());
  11.  
  12.             int totalYield = 0;
  13.             int consumesCrew = 26;
  14.             int daysWork = 0;
  15.  
  16.             if(startingYield >= 100)
  17.             {
  18.                 while (startingYield >= 100)
  19.                 {
  20.  
  21.                     totalYield += startingYield;
  22.                     totalYield -= consumesCrew;
  23.                     daysWork++;
  24.                     startingYield -= 10;
  25.                 }
  26.                 totalYield -= consumesCrew;  
  27.             }
  28.  
  29.             Console.WriteLine(daysWork);
  30.             Console.WriteLine(totalYield);
  31.  
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment