Advertisement
SvPt

GrandTheftExamo

Oct 24th, 2015
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. class GrandTheftExamo
  4. {
  5.     static void Main()
  6.     {
  7.         byte numerOfAttempts = byte.Parse(Console.ReadLine());
  8.  
  9.         long thievesSlaped = 0;
  10.         long thievesEscaped = 0;
  11.         long totalBeers = 0;
  12.  
  13.         for (int i = 0; i < numerOfAttempts; i++)
  14.         {
  15.            
  16.             long thievesAttemtEscape = long.Parse(Console.ReadLine());
  17.             long amountOfBeer = long.Parse(Console.ReadLine());
  18.  
  19.             if (thievesAttemtEscape > 5)
  20.             {
  21.                 thievesEscaped += thievesAttemtEscape - 5;
  22.                 thievesSlaped += 5;
  23.                 totalBeers += amountOfBeer;
  24.             }
  25.             else
  26.             {
  27.                 thievesSlaped += thievesAttemtEscape;
  28.                 totalBeers += amountOfBeer;
  29.             }
  30.         }
  31.         Console.WriteLine("{0} thieves slapped.", thievesSlaped);
  32.         Console.WriteLine("{0} thieves escaped.", thievesEscaped);
  33.         Console.WriteLine("{0} packs, {1} bottles.", totalBeers / 6, totalBeers % 6);
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement