Advertisement
ralichka

02.DataTypes-09.SpiceMustFlow

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