Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int attemps = int.Parse(Console.ReadLine());
- long thievesSlapped = 0;
- long totalBeers = 0;
- long thievesEscapped = 0;
- for (long i = 0; i < attemps; i++)
- {
- long thieves = long.Parse(Console.ReadLine());
- long beers = long.Parse(Console.ReadLine());
- if (thieves>5)
- {
- thievesEscapped = thieves + thievesEscapped - 5;
- thievesSlapped = thievesSlapped + 5;
- totalBeers = totalBeers + beers;
- }
- else
- {
- thievesSlapped = thievesSlapped + thieves;
- totalBeers = totalBeers + beers;
- }
- }
- //decimal slaps = attemps * 5;
- //decimal escapes = thievesSlapped - slaps;
- //decimal packs = 0;
- //if (totalBeers >= 6)
- //{
- // packs = packs + 1;
- // totalBeers = totalBeers - 6;
- //}
- Console.WriteLine("{0} thieves slapped.\n{1} thieves escaped.\n{2} packs, {3} bottles.", thievesSlapped, thievesEscapped, totalBeers/6, totalBeers%6);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement