Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2.  
  3. namespace appleProduction
  4. {
  5.    
  6.     class Program
  7.     {
  8.        
  9.         static void Main(string[] args)
  10.         {
  11.            
  12.             int year = 1990;
  13.             double production = 20;
  14.             double totalProduction = 20;
  15.             int year90Tons = 1990;
  16.  
  17.             do
  18.             {
  19.                
  20.                 if (totalProduction <= 90)
  21.                 {
  22.                     year90Tons ++;
  23.                 }
  24.  
  25.                 if (production >= 5)
  26.                 {
  27.                     year++;
  28.                 }
  29.                 production = production - production * 0.2;
  30.                 totalProduction = totalProduction + production;
  31.                
  32.  
  33.             } while (!(totalProduction >= 90 &&  production <= 5));
  34.  
  35.             Console.WriteLine("Първа година на продукция под 5 тона:" + year);
  36.             Console.WriteLine("Година при която е достигната 90 тонна продукция:" + year90Tons);
  37.  
  38.         }
  39.        
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement