Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int v = int.Parse(Console.ReadLine());
- int p1 = int.Parse(Console.ReadLine());
- int p2 = int.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- double x, y, z;
- double p = p1 * h;
- double c = p2 * h;
- x = (p + c) / 1000 * 100;
- y = (p / (p + c)) * 100;
- z = (c / (p + c)) * 100;
- if (p + c > v)
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", h, (p + c) - v);
- else
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", (int)x, (int)y, (int)z);
- }
- }
- }using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int v = int.Parse(Console.ReadLine());
- int p1 = int.Parse(Console.ReadLine());
- int p2 = int.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- double x, y, z;
- double p = p1 * h;
- double c = p2 * h;
- x = (p + c) / 1000 * 100;
- y = (p / (p + c)) * 100;
- z = (c / (p + c)) * 100;
- if (p + c > v)
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", h, (p + c) - v);
- else
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", (int)x, (int)y, (int)z);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement