Advertisement
M0Hk

Aquarium

Sep 17th, 2023
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | Software | 0 0
  1. using System;
  2. using System.Diagnostics.Metrics;
  3.  
  4. namespace firstLesson
  5. {
  6.     internal class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int length = int.Parse(Console.ReadLine());
  11.             int width = int.Parse(Console.ReadLine());
  12.             int height = int.Parse(Console.ReadLine());
  13.             double percent = double.Parse(Console.ReadLine());
  14.  
  15.             double volumeLiters = length * width * height * 0.001;
  16.             double waterPercent = 1 - (percent / 100);
  17.  
  18.             double result = volumeLiters * waterPercent;
  19.  
  20.             string formattedResult = result.ToString("F2");
  21.  
  22.             Console.WriteLine(formattedResult);
  23.  
  24.         }
  25.     }
  26. }
Tags: aquarium
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement