Guest User

Untitled

a guest
Nov 17th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Wire_net
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double tomatoamount = double.Parse(Console.ReadLine());
  10. tomatoamount = Math.Round(tomatoamount, 2);
  11. int boxes = int.Parse(Console.ReadLine());
  12. int jars = int.Parse(Console.ReadLine());
  13. double lutenica = tomatoamount / 5;
  14. Console.WriteLine($"Total lutenica: {Math.Round(lutenica)} kilograms.");
  15. double alljars = lutenica / 0.535;
  16. double allboxes = alljars / jars;
  17. if(allboxes > boxes)
  18. {
  19. Console.WriteLine($"{Math.Floor((allboxes - boxes))} boxes left.");
  20. Console.WriteLine($"{Math.Floor((alljars - jars*boxes))} jars left.");
  21. }
  22. else
  23. {
  24. Console.WriteLine($"{Math.Floor(boxes - allboxes)} more boxes needed.");
  25. Console.WriteLine($"{Math.Floor(jars*boxes - alljars)} more jars needed.");
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment