Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ex_Water_Overflow
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int liters = int.Parse(Console.ReadLine());
- int capacity = 255;
- int sumLiters = 0;
- for (int i = 0; i <= n; i++)
- {
- if (capacity >= sumLiters)
- {
- Console.WriteLine("Insufficient capacity!");
- Console.WriteLine($"{sumLiters}");
- }
- sumLiters += liters;
- n--;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment