Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace appleProduction
- {
- class Program
- {
- static void Main(string[] args)
- {
- int year = 1990;
- double production = 20;
- double totalProduction = 20;
- int year90Tons = 1990;
- do
- {
- if (totalProduction <= 90)
- {
- year90Tons ++;
- }
- if (production >= 5)
- {
- year++;
- }
- production = production - production * 0.2;
- totalProduction = totalProduction + production;
- } while (!(totalProduction >= 90 && production <= 5));
- Console.WriteLine("Първа година на продукция под 5 тона:" + year);
- Console.WriteLine("Година при която е достигната 90 тонна продукция:" + year90Tons);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement