Advertisement
IvetValcheva

08. Fish Tank

Apr 4th, 2021
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FirstStepsInCodding
  4.     {
  5.         class Program
  6.         {
  7.             static void Main(string[] args)
  8.             {
  9.             int lenght = int.Parse(Console.ReadLine());
  10.             int width = int.Parse(Console.ReadLine());
  11.             int heigh = int.Parse(Console.ReadLine());
  12.             double percentage = double.Parse(Console.ReadLine());
  13.  
  14.             //volume = lenght * width * heigh
  15.             // litres = volume * 0.001
  16.             //percentage= percentage * 0.01
  17.             //totalLitres =  litres * (1 - percentage)
  18.             double volume = lenght * width * heigh;
  19.             double liters = volume * 0.001;
  20.             percentage = percentage * 0.01;
  21.             double totalLitres = liters * (1 - percentage);
  22.  
  23.             //izhod: litrite, koito trqbw da naleem
  24.             Console.WriteLine(totalLitres);
  25.         }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement