Aliendreamer

thievesEscape30/100

Feb 18th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace issue2Thieves
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int ThievesMaxSlapped=5*n;
  15.             int thieves=0;
  16.             double Beers = 0;
  17.             for(int i=0;i<n;i++)
  18.             {
  19.                 thieves += int.Parse(Console.ReadLine());
  20.                
  21.                 Beers +=int.Parse(Console.ReadLine());
  22.             }
  23.             int ThievesEscaped = thieves - ThievesMaxSlapped;
  24.             double Sixpack =Math.Floor(Beers / 6);
  25.             double bottles =Beers % 6;
  26.  
  27.  
  28.  
  29.             Console.WriteLine("{0} thieves slapped.\n{1} thieves escaped.\n{2} packs, {3} bottles.", ThievesMaxSlapped, ThievesEscaped,Sixpack,bottles);
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment