ramsess90

Untitled

Feb 6th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Тръби_в_басейн
  4. {
  5.     class Program
  6.     {
  7.         static void Main ( string[] args )
  8.         {
  9.             int V = int.Parse(Console.ReadLine());
  10.             int P1 = int.Parse(Console.ReadLine());
  11.             int P2 = int.Parse(Console.ReadLine());
  12.             double H = double.Parse(Console.ReadLine());
  13.  
  14.  
  15.             if (((P1 + P2) * H) < V)
  16.             {
  17.                 Console.WriteLine($"The pool is {(int)(((P1 + P2) * H * 100) / V)}% full. Pipe 1: {(int)((P1 *100) / (P1 + P2))}%. Pipe 2: {(int)((P2 * 100) / (P1 + P2))}%.");
  18.             }
  19.             else
  20.             {
  21.  
  22.                 Console.WriteLine($"For {H} hours the pool overflows with {(((P1 + P2) * H) - V)} liters.");
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment