Advertisement
Guest User

Untitled

a guest
Jul 12th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class PetarsGame
  5. {
  6.  
  7. static void Main()
  8. {
  9.  
  10. int n = int.Parse(Console.ReadLine());
  11.  
  12. long vonSlapped = 0; //___________________
  13. long vonEscape = 0;
  14. long beer = 0;
  15. long resultSlapped = 0;
  16. long count = 0;
  17.  
  18. for (int i = 1; i <= n; i++)
  19. {
  20. count++;
  21.  
  22. long amountOfThieves = long.Parse(Console.ReadLine());
  23. long beer2 = long.Parse(Console.ReadLine());
  24.  
  25. if (amountOfThieves > 5)
  26. {
  27. vonSlapped += 5; //___________________
  28.  
  29. resultSlapped = amountOfThieves - 5; //___________________
  30.  
  31. vonEscape += resultSlapped;
  32.  
  33. }
  34. else
  35. {
  36. vonSlapped += amountOfThieves;
  37. vonEscape = 0;
  38. }
  39. if (beer2 < 999999999999999999)
  40. {
  41. beer += beer2;
  42. }
  43.  
  44. }
  45. //double resultSlappedd = resultSlapped * count;
  46.  
  47. Console.WriteLine("{0} thieves slapped.", vonSlapped); //___________________
  48. Console.WriteLine("{0} thieves escaped.", vonEscape);
  49. Console.WriteLine("{0} packs, {1} bottles.", beer / 6, beer % 6);
  50.  
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement