Advertisement
ktopchiev

Lutenitsa

Nov 25th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Lutenitza
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double tomatoesQuantityInKg = double.Parse(Console.ReadLine());
  14.             int boxesNum = int.Parse(Console.ReadLine());
  15.             int jarsNum = int.Parse(Console.ReadLine());
  16.             double lutenitsaKg = tomatoesQuantityInKg / 5;
  17.             double jars = lutenitsaKg / 0.535;
  18.             double boxes = jars / jarsNum;
  19.             Console.WriteLine("Total lutenica: " + Math.Floor(lutenitsaKg) + "kilograms.");
  20.             if (boxes > boxesNum)
  21.             {
  22.                 Console.WriteLine(Math.Floor(boxes - boxesNum) + " boxes left.");
  23.                 Console.WriteLine(Math.Floor(jars - (boxesNum * jarsNum)) + " jars left.");
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine(Math.Floor(boxesNum - boxes) + " more boxes needed.");
  28.                 Console.WriteLine(Math.Floor((boxesNum - boxes) * jarsNum) + " more jars needed.");
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement