Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"reflect"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func scanBoard() [][]int {
	ret := make([][]int, 8)
	for k := range ret {
		ret[k] = make([]int, 8)
		for l := range ret[k] {
			ret[k][l] = 0
		}
	}
	for i := 0; i < 8; i++ {
		scanner.Scan()
		row := strings.Split(scanner.Text(), "")
		for j := 0; j < 8; j++ {
			ret[i][j], _ = strconv.Atoi(row[j])
		}
	}
	return ret
}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, [][]int{}) {
			break
		}
		fmt.Println(board)
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i][j+1] == 1 && board[i+1][j+1] == 1 {
					ans = "A"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i+2][j] == 1 && board[i+3][j] == 1 {
					ans = "B"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i][j+1] == 1 && board[i][j+2] == 1 && board[i][j+3] == 1 {
					ans = "C"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j+1] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 && board[i+2][j] == 1 {
					ans = "D"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i][j+1] == 1 && board[i+1][j+1] == 1 && board[i+1][j+2] == 1 {
					ans = "E"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j+1] == 1 && board[i][j+2] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 {
					ans = "G"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 && board[i+2][j+1] == 1 {
					ans = "F"
				}
			}
		}
		fmt.Println(ans)
	}
}

C++: #include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
int main() {
  char c[11][11];
  vector<int> v;
  int dat[7][6]={{1,1,1,1,0,0},{1,0,1,0,1,0},{1,1,0,0,0,0},{1,0,1,0,0,0},{1,1,0,1,0,0},
  {1,0,1,1,0,1},{1,1,1,0,0,0}};
  int i,j,k,x,y,f;
  while(true) {
      f=0;
	  for (i=0;i<8;i++) {
		  if (gets(c[i])==NULL) { i=10; break;}
		  if (f==0) for (j=0;j<8;j++) if (c[i][j]=='1') { f=1; x=j; y=i; j=9;}
	  }
	  if (i==10) break;
	  cout << endl;
	  for (k=0;k<7;k++) {
		  f=0;
		  for (i=0;i<3;i++) for (j=0;j<2;j++) {
			  if (x+j>7 || y+i>7) { if (dat[k][j+i*2]==0) f++;}  else
				  if (c[y+i][x+j]==('0'+dat[k][j+i*2])) f++;
		  }
		  if (f==6) break;
	  }
	  v.push_back(k);
  }
  for (i=0;i<v.size();i++) cout << (char)('A'+v[i]) << endl;
  return 0

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
 
char s[18][18];
string buf;
int main(){
    do{
        memset(s,0,sizeof(s));
        for(int i=1;i<=8;i++)scanf("%s",s[i]+1);
        for(int i=1;i<=8;i++){
            for(int j=1;j<=8;j++){
                if(s[i][j]!='1')continue;
                if(s[i][j+1]=='1'&&s[i+1][j+1]=='1'&&s[i+1][j]=='1'){puts("A");goto p;}
                if(s[i+1][j]=='1'&&s[i+2][j]=='1'&&s[i+3][j]=='1'){puts("B");goto p;}
                if(s[i][j+1]=='1'&&s[i][j+2]=='1'&&s[i][j+3]=='1'){puts("C");goto p;}
                if(s[i+1][j-1]=='1'&&s[i+1][j]=='1'&&s[i+2][j-1]=='1'){puts("D");goto p;}
                if(s[i][j+1]=='1'&&s[i+1][j+1]=='1'&&s[i+1][j+2]=='1'){puts("E");goto p;}
                if(s[i+1][j]=='1'&&s[i+1][j+1]=='1'&&s[i+2][j+1]=='1'){puts("F");goto p;}
                if(s[i][j+1]=='1'&&s[i+1][j-1]=='1'&&s[i+1][j]=='1'){puts("G");goto p;}
            }
        }
        p:;
    }while(getline(cin,buf));
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {

    string s;
    string graph[7] =
    {
        "1100110000000000",
        "1000100010001000",
        "1111000000000000",
        "0100110010000000",
        "1100011000000000",
        "1000110001000000",
        "0110110000000000"
    };

    int find;
    char field[8][9];

    while(cin >> field[0]) {

        s = "";
        find = 0;

        for(int i = 1; i < 8; ++i) {
            cin >> field[i];
        }

        for(int i = 0; i < 8 && find == 0; ++i) {
            for(int j = 0; j < 6 && find == 0; ++j) {
                if(field[i][j] == '1' || field[i][j + 1] == '1' && field[i - 1][j] == '1') {
                    find = 1;
                    for(int k = i; k < i + 4; ++k) {
                        for(int l = j; l < j + 4; ++l) {
                            s += field[k][l];
                        }
                    }
                }
            }
        }

        for(int i = 0; i < 7; ++i) {
            if(s == graph[i]) {
                cout << (char)('A' + i) << endl;
                break;
            }
        }

    }

}

C++: #include <cstdio>
#include <iostream>
using namespace std;
int main()
{
	char f[8][8];
	int x,y,i,j;
	while(1)
	{
		x=y=-1;
		for(i=0;i<8;i++)cin >> f[i];
		if(cin.eof())break;
		for(x=0;x<8;x++)
		{
			for(y=0;y<8;y++)
			{
				if(f[x][y]=='1')
				{
					i=x;
					j=y;
					break;
				}
			}
			if(i==x&&j==y)break;
		}
		if(i<7&&j<7&&f[i+1][j]=='1'&&f[i][j+1]=='1')printf("A\n");
		else if(i<5&&f[i+3][j]=='1')printf("B\n");
		else if(j<5&&f[i][j+3]=='1')printf("C\n");
		else if(i<6&&j>0&&f[i+2][j-1]=='1')printf("D\n");
		else if(i<7&&j<6&&f[i+1][j+2]=='1')printf("E\n");
		else if(i<6&&j<7&&f[i+2][j+1]=='1')printf("F\n");
		else if(i<7&&j<7&&j>0&&f[i][j+1]=='1'&&f[i+1][j-1]=='1')printf("G\n");
	}
	return 0;
}

C++: #include<cstdio>

int main(){
  char a[64];
  while(scanf("%s",&a[0])>0){
    for(int i=1;i<8;i++)
      scanf("%s",&a[8*i]);
    for(int i=0;i<64;i++){
      if(a[i]=='1'){
	if(a[i+1]=='1'){
	  if(a[i+2]=='1'){
	    puts("C");
	  }else if(a[i+7]=='1'){
	    puts("G");
	  }else if(a[i+8]=='1'){
	    puts("A");
	  }else{
	    puts("E");
	  }
	}else{
	  if(a[i+7]=='1'){
	    puts("D");
	  }else if(a[i+9]=='1'){
	    puts("F");
	  }else{
	    puts("B");
	  }
	}
	break;
      }
    }
  }
}

C++: #include<iostream>
#include<cstdio>

char data[8][8];
int px, py;

int main(){
	while (true){
		for(int i = 0; i < 8 ; i++){
			for(int j = 0; j < 8; j++){
				if(!(std::cin >> data[i][j]))goto end;
				if(data[i][j] == '1')px = j, py = i;
			}
		}

		if (data[py][px - 1] == '1' && data[py - 1][px] == '1' && data[py - 1][px - 1] == '1')printf("A\n");
		else if (data[py - 1][px] == '1' && data[py - 2][px] == '1' && data[py - 3][px] == '1')printf("B\n");
		else if (data[py][px - 1] == '1' && data[py][px - 2] == '1' && data[py][px - 3] == '1')printf("C\n");
		else if (data[py - 1][px] == '1' && data[py - 1][px + 1] == '1' && data[py - 2][px + 1] == '1')printf("D\n");
		else if (data[py][px - 1] == '1' && data[py - 1][px - 1] == '1' && data[py - 1][px - 2] == '1')printf("E\n");
		else if (data[py - 1][px] == '1' && data[py - 1][px - 1] == '1' && data[py - 2][px - 1] == '1')printf("F\n");
		else if (data[py - 1][px] == '1' && data[py - 1][px + 1] == '1' && data[py][px - 1] == '1')printf("G\n");
	}
	end:;
	return 0;
}