Advertisement
Guest User

Untitled

a guest
Feb 10th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int attemps = int.Parse(Console.ReadLine());
  7.  
  8.         long thievesSlapped = 0;
  9.         long totalBeers = 0;
  10.         long thievesEscapped = 0;
  11.        
  12.         for (long i = 0; i < attemps; i++)
  13.         {
  14.             long thieves = long.Parse(Console.ReadLine());
  15.             long beers = long.Parse(Console.ReadLine());
  16.  
  17.             if (thieves>5)
  18.             {
  19.                 thievesEscapped = thieves + thievesEscapped - 5;
  20.                 thievesSlapped = thievesSlapped + 5;
  21.                 totalBeers = totalBeers + beers;
  22.             }
  23.             else
  24.             {
  25.                 thievesSlapped = thievesSlapped + thieves;
  26.                 totalBeers = totalBeers + beers;
  27.             }
  28.         }
  29.  
  30.         //decimal slaps = attemps * 5;
  31.         //decimal escapes = thievesSlapped - slaps;
  32.         //decimal packs = 0;
  33.        
  34.         //if (totalBeers >= 6)
  35.         //{
  36.         //    packs = packs + 1;
  37.         //    totalBeers = totalBeers - 6;
  38.         //}
  39.  
  40.         Console.WriteLine("{0} thieves slapped.\n{1} thieves escaped.\n{2} packs, {3} bottles.", thievesSlapped, thievesEscapped, totalBeers/6, totalBeers%6);
  41.        
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement