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;
- class Beers
- {
- static void Main()
- {
- string[] input = Console.ReadLine().Split(' ');
- int beers = 0;
- int stacks = 0;
- while (input[0] != "End")
- {
- if (input[1] == "beers")
- {
- beers += Int32.Parse(input[0]);
- }
- else
- {
- stacks += int.Parse(input[0]);
- }
- input = Console.ReadLine().Split(' ');
- }
- stacks += beers / 20;
- beers %= 20;
- Console.WriteLine("{0} stacks + {1} beers", stacks, beers);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement