Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Cake
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int pieces = a * b;
- for (int i = 0; i < pieces; i++)
- {
- int num = int.Parse(Console.ReadLine());
- pieces -= num;
- }
- string pieces2 = pieces.ToString();
- var stop = Console.ReadLine().ToLower();
- // i s dvata varianta ne stava
- if (pieces2 == "stop")
- { Console.WriteLine("{0} pieces are left.", pieces); }
- else if (pieces < 0)
- { Console.WriteLine($"No more cake left! You need {Math.Abs(pieces)} pieces more."); }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement