Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01.MidExam
- {
- class Program
- {
- static void Main(string[] args)
- {
- // int biscuitsPerWorkerPerDay = int.Parse(Console.ReadLine());
- double biscuitsPerWorkerPerDay = double.Parse(Console.ReadLine());
- double temp = biscuitsPerWorkerPerDay;
- int countOfWorkers = int.Parse(Console.ReadLine());
- int biscuitsCompetitor30Days = int.Parse(Console.ReadLine());
- double biscuitsPerWorkerProduced = 0;
- for (int day = 1; day <= 30; day++)
- {
- int currentDay = day;
- if (currentDay % 3 == 0)
- {
- biscuitsPerWorkerPerDay = 0.75 * biscuitsPerWorkerPerDay;
- //biscuitsPerWorkerPerDay = (int)Math.Round(0.75 * biscuitsPerWorkerPerDay);
- }
- else
- {
- biscuitsPerWorkerPerDay = temp;
- }
- biscuitsPerWorkerProduced = biscuitsPerWorkerProduced + Math.Round(biscuitsPerWorkerPerDay);
- }
- double totalBiscuits30Days = biscuitsPerWorkerProduced * countOfWorkers;
- double differentProduction = totalBiscuits30Days - biscuitsCompetitor30Days;
- double percentage = Math.Abs(differentProduction / biscuitsCompetitor30Days) * 100;
- Console.WriteLine($"You have produced {totalBiscuits30Days} biscuits for the past month.");
- if (differentProduction > 0)
- {
- Console.WriteLine($"You produce {percentage:f2} percent more biscuits.");
- }
- else
- {
- Console.WriteLine($"You produce {percentage:f2} percent less biscuits.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement