YORDAN2347

09. SpiceMustFlow

Jan 24th, 2021 (edited)
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _09._SpiceMustFlow
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int startingYield = int.Parse(Console.ReadLine());
  10.             int days = 0;
  11.  
  12.             int totalYield = 0;
  13.            
  14.             if (startingYield > 100)
  15.             {
  16.                 while (startingYield >= 100)
  17.                 {
  18.                     days++;
  19.                     totalYield += startingYield;
  20.                     totalYield -= 26;
  21.                     startingYield -= 10;
  22.                 }
  23.                 totalYield -= 26;              
  24.             }
  25.             Console.WriteLine(days);
  26.             Console.WriteLine(totalYield);
  27.         }
  28.     }
  29. }
  30.  
Add Comment
Please, Sign In to add comment