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
}

var emptyBoard = [][]int{{0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0}}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, emptyBoard) {
			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 <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
	char p[8][9];
	int i,j;
	while(cin>>p[0]>>p[1]>>p[2]>>p[3]>>p[4]>>p[5]>>p[6]>>p[7]){
		for(i=0; i<8 ; ++i){
			for(j=0 ;j < 9 ; ++j){
				if(p[i][j]=='1') goto next; 
			}
		}
		next:
		if (p[i][j+1]=='1' &&p[i+1][j]=='1' && p[i+1][j+1]=='1') cout << 'A' << endl;
		else if (p[i+1][j]=='1' && p[i+2][j]=='1' && p[i+3][j]=='1') cout << 'B' << endl;
		else if (p[i][j+1]=='1' && p[i][j+2]=='1' && p[i][j+3]=='1') cout << 'C' << endl;
		else if (p[i+1][j]=='1' && p[i+1][j-1]=='1' && p[i+2][j-1]=='1' ) cout << 'D' << endl;
		else if (p[i][j+1]=='1' && p[i+1][j+1]=='1' && p[i+1][j+2]=='1' ) cout << 'E' << endl;
		else if (p[i+1][j]=='1' && p[i+1][j+1]=='1' && p[i+2][j+1]=='1' ) cout << 'F' << endl;
		else if (p[i][j+1]=='1' && p[i+1][j+1]=='1' && p[i+1][j-1]=='1' ) cout << 'G' << endl;
	}
	return 0; 
}

C++: #include<iostream>
using namespace std;
string str[8], tmp;
char ch;
int main() {
	while (cin >> str[0]) {
		for (int i = 1; i < 8; i++)cin >> str[i];
		getline(cin, tmp);
		//11
		//11
		for (int i = 0; i < 7; i++) {
			for (int j = 0; j < 7; j++) {
				if (str[i][j] == '1' && str[i + 1][j] == '1' && str[i][j + 1] == '1' && str[i + 1][j + 1] == '1') {
					ch = 'A';
				}
			}
		}

		//1
		//1
		//1
		//1
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 8; j++) {
				if (str[i][j] == '1' && str[i + 1][j] == '1' && str[i + 2][j] == '1' && str[i + 3][j] == '1')ch = 'B';
			}
		}

		//1111
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 5; j++) {
				if (str[i][j] == '1' && str[i][j + 1] == '1' && str[i][j + 2] == '1' && str[i][j + 3] == '1')ch = 'C';
			}
		}

		//01
		//11
		//10
		for (int i = 0; i < 6; i++) {
			for (int j = 0; j < 7; j++) {
				if (str[i][j + 1] == '1' && str[i + 1][j] == '1' && str[i + 1][j + 1] == '1' && str[i + 2][j] == '1')ch = 'D';
			}
		}

		//110
		//011
		for (int i = 0; i < 7; i++) {
			for (int j = 0; j < 6; j++) {
				if (str[i][j] == '1' && str[i][j + 1] == '1' && str[i + 1][j + 1] == '1' && str[i + 1][j + 2] == '1')ch = 'E';
			}
		}

		//011
		//110
		for (int i = 0; i < 7; i++) {
			for (int j = 0; j < 6; j++) {
				if (str[i][j + 1] == '1' && str[i][j + 2] == '1' && str[i + 1][j] == '1' && str[i + 1][j + 1] == '1')ch = 'G';
			}
		}

		//10
		//11
		//01
		for (int i = 0; i < 6; i++) {
			for (int j = 0; j < 7; j++) {
				if (str[i][j] == '1' && str[i + 1][j] == '1' && str[i + 1][j + 1] == '1' && str[i + 2][j + 1] == '1')ch = 'F';
			}
		}

		cout << ch << endl;
	}
	return 0;
}

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

int main(){
  bool bmap[10][10];
  string s;
  for(int i=1;i<=8;i++){
    cin >> s;
    for(int j=0;j<s.length();j++){
      if(s[j] == '0')bmap[i][j+1] = false;
      else bmap[i][j+1] = true;
    }
  }
  for(int i=1;i<=8;i++){
    for(int j=1;j<=8;j++){
      if(bmap[i][j]){
	if(j+1<= 8 && i+1<=8 &&bmap[i][j+1] && bmap[i+1][j] && bmap[i+1][j+1]){
	  cout << "A" << endl; break;
	}
	else if(i+3<=8 && bmap[i+1][j] && bmap[i+2][j] && bmap[i+3][j]){
	  cout << "B" << endl; break;
	}
	else if(j+3<=8 && bmap[i][j+1] && bmap[i][j+2] && bmap[i][j+3]){
	  cout << "C" << endl; break;
	}
	else if(i+2<=8 && 1<=j-1 && bmap[i+1][j] && bmap[i+1][j-1] && bmap[i+2][j-1]){
	  cout << "D" << endl; break;
	}
	else if(i+1<=8 && j+2<=8 && bmap[i][j+1] && bmap[i+1][j+1] && bmap[i+1][j+2]){
	  cout << "E" << endl; break;
	}
	else if(i+2<=8 && j+1<=8 && j+1<=8 && bmap[i+1][j] && bmap[i+1][j+1] && bmap[i+2][j+1]){
	  cout << "F" << endl; break;
	}
	else if(j+1<=8 && 1<=j-1 && j+1<=8 && bmap[i][j+1] && bmap[i+1][j] && bmap[i+1][j-1]){
	  cout << "G" << endl; break;
	}
      }
    }
  }
  return 0;
}

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

const int X_END = 8;
const int Y_END = 8;

char m[Y_END][X_END + 1];

char whatFigure() {
    for (int y = 0; y < Y_END; y++) {
        for (int x = 0; x < X_END; x++) {
            if (m[y][x] == '1') {
                if (x+1 < X_END && y+1 < Y_END
                    && m[y][x+1] == '1' && m[y+1][x] == '1' && m[y+1][x+1] == '1') {
                    return 'A';
                } else if (y+3 < Y_END
                           && m[y+1][x] == '1' && m[y+2][x] == '1' && m[y+3][x] == '1') {
                    return 'B';
                } else if (x+3 < X_END
                           && m[y][x+1] == '1' && m[y][x+2] == '1' && m[y][x+3] == '1') {
                    return 'C';
                } else if (x >= 1 && y+2 < Y_END
                           && m[y+1][x] == '1' && m[y+1][x-1] == '1' && m[y+2][x-1] == '1') {
                    return 'D';
                } else if (x+2 < X_END && y+1 < Y_END
                           && m[y][x+1] == '1' && m[y+1][x+1] == '1' && m[y+1][x+2] == '1') {
                    return 'E';
                } else if (x+1 < X_END && y+2 < Y_END
                           && m[y+1][x] == '1' && m[y+1][x+1] == '1' && m[y+2][x+1] == '1') {
                    return 'F';
                } else if (x >= 1 && x+1 < X_END && y+1 < Y_END
                           && m[y][x+1] == '1' && m[y+1][x] == '1' && m[y+1][x-1] == '1') {
                    return 'G';
                }
            }
        }
    }
    return '0';
}

int main() {
    while (cin >> m[0]) {
        for (int i = 1; i < 8; i++) {
            cin >> m[i];
        }
        cout << whatFigure() << endl;
    }
}