Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- int tails = 0;
- int heads = 0;
- int edge = 0;
- int airFLoating = 0;
- int counter = 0;
- for (int i = 0; i < input.Length; i++)
- {
- if (input[i] == 0)
- {
- tails++;
- }
- if (input[i] == 1)
- {
- heads++;
- }
- if (input[i] == 2)
- {
- edge++;
- }
- if (input[i] == 3)
- {
- airFLoating++;
- }
- counter++;
- if (tails == 3)
- {
- Console.WriteLine($"{counter}: Beers!");
- break;
- }
- if (heads == 3)
- {
- Console.WriteLine($"{counter}: Party");
- break;
- }
- if (edge == 3)
- {
- Console.WriteLine($"{counter}: Work on the project");
- break;
- }
- if (airFLoating == 3)
- {
- Console.WriteLine($"{counter}: May the DSA Force be with you!");
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment