Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ANDProcessors
- {
- class Program
- {
- static void Main(string[] args)
- {
- int processors = int.Parse(Console.ReadLine());
- int workers = int.Parse(Console.ReadLine());
- int days = int.Parse(Console.ReadLine());
- double diff = (processors - Math.Floor(workers * days * 8 / 3D)) * 110.10;
- if (diff > 0)
- {
- Console.WriteLine($"Losses: -> { diff:F2} BGN");
- }
- else
- {
- Console.WriteLine($"Profit: -> { Math.Abs(diff):F2} BGN");
- }
- }
- }
- }
- РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОP:
- using System;
- namespace ANDProcessors
- {
- class Program
- {
- static void Main(string[] args)
- {
- int processors = int.Parse(Console.ReadLine());
- int workers = int.Parse(Console.ReadLine());
- int days = int.Parse(Console.ReadLine());
- double diff = (processors - Math.Floor(workers * days * 8 / 3D)) * 110.10;
- Console.WriteLine($"{(diff > 0 ? "Losses" : "Profit")}: -> { Math.Abs(diff):F2} BGN");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement