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 NakovBeer
- {
- class NakovBeer
- {
- static void Main()
- {
- int quantity;
- int beerCounter=0;
- for (int loops = 1; loops < 999; loops++)
- {
- string inputData = Console.ReadLine();
- if(inputData=="End")
- {
- break;
- }
- string[] data = inputData.Split(' ');
- quantity = int.Parse(data[0]);
- if (quantity > 99 || quantity < 1)
- {
- Console.WriteLine("NOT CORECT Please try adain");
- quantity=0;
- }
- string type = data[1];
- if(type=="stacks")
- {
- beerCounter +=quantity*20;
- }
- else
- {
- beerCounter += quantity;
- }
- }
- int stacks = beerCounter / 20;
- int beers = beerCounter % 20;
- Console.WriteLine("{0} stacks + {1} beers",stacks,beers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement