Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Wire_net
- {
- class Program
- {
- static void Main(string[] args)
- {
- double tomatoamount = double.Parse(Console.ReadLine());
- tomatoamount = Math.Round(tomatoamount, 2);
- int boxes = int.Parse(Console.ReadLine());
- int jars = int.Parse(Console.ReadLine());
- double lutenica = tomatoamount / 5;
- Console.WriteLine($"Total lutenica: {Math.Round(lutenica)} kilograms.");
- double alljars = lutenica / 0.535;
- double allboxes = alljars / jars;
- if(allboxes > boxes)
- {
- Console.WriteLine($"{Math.Floor((allboxes - boxes))} boxes left.");
- Console.WriteLine($"{Math.Floor((alljars - jars*boxes))} jars left.");
- }
- else
- {
- Console.WriteLine($"{Math.Floor(boxes - allboxes)} more boxes needed.");
- Console.WriteLine($"{Math.Floor(jars*boxes - alljars)} more jars needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment