Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CookieFactory
- {
- class Program
- {
- static void Main(string[] args)
- {
- int biscuits = int.Parse(Console.ReadLine());
- int workersCount = int.Parse(Console.ReadLine());
- int competingFactoryBiscuits = int.Parse(Console.ReadLine());
- double productionPerDay = 0;
- double totalProduction = 0;
- double biscuitsPerThreeDays = 0;
- for (int i = 1; i <= 30; i++)
- {
- if (i % 3 == 0)
- {
- biscuitsPerThreeDays = biscuits * workersCount;
- biscuitsPerThreeDays *= 0.75;
- productionPerDay += biscuitsPerThreeDays;
- }
- else
- {
- productionPerDay = biscuits * workersCount;
- }
- totalProduction += productionPerDay;
- productionPerDay = 0;
- }
- Console.WriteLine($"You have produced {totalProduction} biscuits for the past month.");
- double difference = 0;
- if(totalProduction < competingFactoryBiscuits)
- {
- difference = competingFactoryBiscuits - totalProduction;
- Console.WriteLine($"You produce {(difference/competingFactoryBiscuits*100):F2} percent less biscuits.");
- }
- else
- {
- difference = totalProduction - competingFactoryBiscuits;
- Console.WriteLine($"You produce {(difference/competingFactoryBiscuits*100):F2} percent more biscuits.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement