Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.Design;
- using System.Data;
- using System.Globalization;
- using System.Linq;
- using System.Net.Http.Headers;
- using System.Runtime.InteropServices.ComTypes;
- using System.Transactions;
- using System.Xml.Linq;
- namespace Homework
- {
- class Program
- {
- static void Main()
- {
- double numberOfBiscuitsPerWorker = double.Parse(Console.ReadLine());
- double countOfWorkers = double.Parse(Console.ReadLine());
- double numberOfBiscuitsOfCompetingFactory = double.Parse(Console.ReadLine());
- double totalBiscuits = 0;
- double totalTotalBiscuits = 0;
- double biscuitsPerThreeDays = 0;
- double moreCookies = 0;
- double percentage = 0;
- for (int days = 1; days <= 30; days++)
- {
- if (days % 3 == 0)
- {
- biscuitsPerThreeDays = numberOfBiscuitsPerWorker * countOfWorkers;
- biscuitsPerThreeDays *= 0.75;
- totalTotalBiscuits += biscuitsPerThreeDays;
- }
- else
- {
- totalBiscuits = numberOfBiscuitsPerWorker * countOfWorkers;
- totalTotalBiscuits += totalBiscuits;
- }
- }
- if (totalTotalBiscuits == numberOfBiscuitsOfCompetingFactory)
- {
- return;
- }
- moreCookies = totalTotalBiscuits - numberOfBiscuitsOfCompetingFactory;
- percentage = moreCookies / numberOfBiscuitsOfCompetingFactory * 100;
- Console.WriteLine($"You have produced {totalTotalBiscuits} biscuits for the past month.");
- if (totalTotalBiscuits > numberOfBiscuitsOfCompetingFactory)
- {
- Console.WriteLine($"You produce {percentage:f2} percent more biscuits. ");
- }
- else if (totalTotalBiscuits < numberOfBiscuitsOfCompetingFactory)
- {
- Console.WriteLine($"You produce {Math.Abs(percentage):f2} percent less biscuits. ");
- }
- else
- {
- return;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment