Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int[] x = new int[8];
- for (int cnt = 0; cnt < 8; cnt++ )
- {
- x[cnt] = int.Parse(Console.ReadLine());
- }
- int counter = 0;
- for (int row = 0; row < 6; row++)
- {
- for (int bitPos = 0; bitPos < 29; bitPos++)
- {
- if ((x[row] >> bitPos & 7) == 5 &&
- (x[row + 1] >> bitPos & 7) == 2 &&
- (x[row + 2] >> bitPos & 7) == 5)
- {
- counter++;
- }
- }
- }
- Console.WriteLine(counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment