Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04._Beehive_Population
- {
- class Program
- {
- static void Main(string[] args)
- {
- int startPopulation = int.Parse(Console.ReadLine());
- int years = int.Parse(Console.ReadLine());
- for (int year = 1; year <= years; year++)
- {
- startPopulation += startPopulation / 10 * 2;
- if (year % 5 == 0)
- {
- startPopulation -= startPopulation / 50 * 5;
- }
- startPopulation -= startPopulation / 20 * 2;
- }
- Console.WriteLine($"Beehive population: {startPopulation}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement