VPanev

Untitled

Nov 17th, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  2.  
  3. int tails = 0;
  4. int heads = 0;
  5. int edge = 0;
  6. int airFLoating = 0;
  7.  
  8. int counter = 0;
  9.  
  10. for (int i = 0; i < input.Length; i++)
  11. {
  12. if (input[i] == 0)
  13. {
  14. tails++;
  15. }
  16.  
  17. if (input[i] == 1)
  18. {
  19. heads++;
  20. }
  21.  
  22. if (input[i] == 2)
  23. {
  24. edge++;
  25. }
  26.  
  27. if (input[i] == 3)
  28. {
  29. airFLoating++;
  30. }
  31. counter++;
  32.  
  33. if (tails == 3)
  34. {
  35. Console.WriteLine($"{counter}: Beers!");
  36. break;
  37. }
  38. if (heads == 3)
  39. {
  40. Console.WriteLine($"{counter}: Party");
  41. break;
  42. }
  43. if (edge == 3)
  44. {
  45. Console.WriteLine($"{counter}: Work on the project");
  46. break;
  47. }
  48. if (airFLoating == 3)
  49. {
  50. Console.WriteLine($"{counter}: May the DSA Force be with you!");
  51. break;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment