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(), "")
		if reflect.DeepEqual(row, []string{}) {
			break
		}
		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 < 7; i++ {
			for j := 0; j < 7; 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 < 5; 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 < 5; 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 < 6; i++ {
			for j := 0; j < 7; 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 < 7; i++ {
			for j := 0; j < 6; 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 < 7; i++ {
			for j := 0; j < 6; 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 < 6; i++ {
			for j := 0; j < 7; 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>

using namespace std;

struct pos {
    int x;  // x座標
    int y;  // y座標
};

int main() {
    // 黒マスで表される部分の座標リスト
    const struct pos fig[7][3] = {
        { {1,0}, {0,1}, {1,1} },    // A
        { {0,1}, {0,2}, {0,3} },    // B
        { {1,0}, {2,0}, {3,0} },    // C
        { {0,1}, {-1,1}, {-1,2} },  // D
        { {1,0}, {1,1}, {2,1} },    // E
        { {0,1}, {1,1}, {1,2} },    // F
        { {1,0}, {0,1}, {-1,1} },   // G
    };
    // マップの領域
    char map[12][12];

    while(1) {
        // マップのリフレッシュ
        for(int y = 0; y < 12; y++) {
            for(int x = 0; x < 12; x++) {
                if(1 >= x && x <= 8 && 1 >= y && y <= 8)    map[x][y] = '0';
                else                                        map[x][y] = '2';
            }
        }

        // データ入力
        bool flag = true;
        struct pos fst;
        for(int y = 0; y < 8; y++) {
            for(int x = 0; x < 8; x++) {
                cin >> map[1+x][1+y];
                if(flag && map[1+x][1+y] == '1') { fst.x = x; fst.y = y; flag = false; }
            }
        }
        if(cin.eof()) {break;}
        
        // 走査
        // あらかじめ最初の1の入力箇所を把握しておく事で、1の出現箇所の探索回数を改善している。
        for(int i = 0; i < 7; i++) {
            if(     map[1+fst.x+fig[i][0].x][1+fst.y+fig[i][0].y] == '1'
                &&  map[1+fst.x+fig[i][1].x][1+fst.y+fig[i][1].y] == '1'
                &&  map[1+fst.x+fig[i][2].x][1+fst.y+fig[i][2].y] == '1')
                {
                cout << (char)('A' + i) << endl;
                break;
            }
        }
    }
    return 0;
}

C++: 
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
char ta[12][12];

bool ok(int y,int x){
	if(y<0||x<0||y>7||x>7)return 0;
	if(ta[y][x]=='1')return 1;
	return 0;
}
int main(){

while(cin>>ta[0][0]){
	int y,x;
	bool f=1;
	for(int i=0;i<8;i++){
		for(int j=(i==0);j<8;j++){
			char now;
			cin>>now;
			if(now=='1'){
			y=i,x=j;
	if( ok(y,x+1)&ok(y+1,x)&&ok(y+1,x+1) ){cout<<"A";f=0;}
	
	else if( ok(y+1,x)&&ok(y+2,x)&&ok(y+3,x) ){cout<<"B";f=0;}
	
	else if( ok(y,x+1)&&ok(y,x+2)&&ok(y,x+3) ){cout<<"C";f=0;}
	
	else if( ok(y+2,x-1)&&ok(y+1,x-1)&&ok(y+1,x)){cout<<"C";f=0;}
	
	else if( ok(y,x+1)&ok(y+1,x+1)&&ok(y+1,x+2) ){cout<<"E";f=0;}
	
	else if( ok(y+1,x)&&ok(y+1,x+1) &&ok(y+2,x+1)){cout<<"F";f=0;}
	
	else if( ok(y,x+1)&&ok(y+1,x)&&ok(y+1,x-1) ){cout<<"G";f=0;}
	
	if(f==0){cout<<endl;goto end:;}
			}
			ta[i][j]=now;
		}
	}
	end:;
		for(int i=0;i<8;i++)for(int j=0;j<8;j++)ta[i][j]='0';
}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <cstring>
using namespace std;
int main (int argc, char const* argv[]) {
  while (true) {
    char map[8][9];
    memset(map, '0', sizeof map);
    if (EOF == scanf("%s",map[0])) break;
    for (int i=1;i<8;i++) scanf("%s",map[i]);
    
    for (int i = 0; i < 8; i += 1) {
      for (int j = 0; j < 8; j += 1) {
        if (map[i][j] == '1') {
          // A
          if (i < 7 && j < 7) {
            if (map[i][j+1]=='1'&&map[i+1][j]=='1'&&map[i+1][j+1]=='1') {
              cout<<"A"<<endl;
              goto out;
            }
          }
          // B
          if (i < 5) {
            if (map[i+1][j]=='1'&&map[i+2][j]=='1'&&map[i+3][j]=='1') {
              cout<<"B"<<endl;
              goto out;
            }
          }
          // C
          if (j < 5) {
            if (map[i][j+1]=='1'&&map[i][j+2]=='1'&&map[i][j+3]=='1') {
              cout<<"C"<<endl;
              goto out;
            }
          }
          // D
          if (i < 6) {
            if (map[i+1][j]=='1'&&map[i-1][j-1]=='1'&&map[i-2][j-1]=='1') {
              cout<<"D"<<endl;
              goto out;
            }
          }
          // E
          if (i < 7 && j < 6) {
            if (map[i][j+1]=='1'&&map[i+1][j+1]=='1'&&map[i+1][j+2]=='1') {
              cout<<"E"<<endl;
              goto out;
            }
          }
          // F
          if (i < 6 && j < 7) {
            if (map[i+1][j]=='1'&&map[i+1][j+1]=='1'&&map[i+2][j+1]=='1') {
              cout<<"F"<<endl;
              goto out;
            }
          }
          // G
          if (i < 7 && j < 5) {
            if (map[i][j+1]=='1'&&map[i+1][j]=='1'&&map[i+1][j-1]=='1') {
              cout<<"G"<<endl;
              goto out;
            }
          }
        }
      }
    }
    out:;
    //scanf("%s",map[0]);
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

#define SIZE 8

int main() {
	string source[SIZE];
	while (true) {
		for (int i = 0; i < SIZE; i++) {
			cin >> source[i];
		}

		int map[14][14], x = SIZE, y = SIZE;
		for (int i = 0; i < SIZE; i++) {
			for (int j = 0; j < SIZE; j++) {
				map[i + 3][j + 3] = source[i][j] == '1' ? 1 : 0;
				if (source[i][j] == '1' && j < x && i < y) {
					x = j;
					y = i;
				}
			}
		}
		x += 3;
		y += 3;

		if (map[y + 1][x + 1] == 1) {
			if (map[y][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "A";
			} else if (map[y + 2][x + 1] == 1) {
				cout << "F";
			} else if (map[y + 1][x + 2] == 1) {
				cout << "E";
			}
		} else if (map[y - 1][x - 1] == 1) {
			if (map[y][x + 1] == 1) {
				cout << "G";
			} else if (map[y + 2][x - 1] == 1) {
				cout << "D";
			}
		} else if (map[y + 3][x]) {
			cout << "B";
		} else {
			cout << "C";
		}
		cout << endl;

		if (!cin) break;
	}
	return 0;
}