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>
using namespace std;

int main()
{
  while (true)
  {
    char board[8][8];
    for (int i=0; i<8; i++)
    {
      for (int j=0; j<8; j++)
      {
        cin >> board[i][j];
      }
    }

    bool flag = false;
    for (int i=0; i<8; i++)
    {
      for (int j=0; j<8; j++)
      {
        if ( board[i][j] == '1' )   //  ブロックがあれば
        {
          if ( board[i+3][j] == '1' )
          {
            cout << 'B' << endl;
          }
          else if ( board[i][j+3] == '1' )
          {
            cout << 'C' << endl;
          }
          else if ( board[i+2][j-1] == '1' )
          {
            cout << 'D' << endl;
          }
          else if ( board[i+1][j+2] == '1' )
          {
            cout << 'E' << endl;
          }
          else if ( board[i+2][j+1] == '1' )
          {
            cout << 'F' << endl;
          }
          else if ( board[i+1][j-1] == '1' )
          {
            cout << 'G' << endl;
          }
          else
          {
            cout << 'A' << endl;
          }
          flag = true;
        }
        if (flag) break;
      }
      if (flag) break;
    }

    char dummy;
    cin >> dummy;
    if ( cin.eof() ) break;
  }
}

C++: #include <iostream>
 
using namespace std;
 
int main(void){
     char field[8][8];
     char tmp;
     int i,j;
	 while(1){
	   for(i=0;i<8;i++){
		 for(j=0;j<8;j++){
		   cin >> field[i][j];
		 }
	   }
 
	   //それぞれの形について判別
	   //まず左上のマスを探す
	   for(i=0;i<8;i++){
		 for(j=0;j<8;j++){
		   if(field[i][j] == '1') goto NEXT;
		 }
	   }
	 NEXT:
	   if(j+3 <= 7 && field[i][j+1] == '1' && field[i][j+2] == '1' && field[i][j+3] == '1'){
		 //横一列
		 cout << "C" << endl;
	   }else if(i+3 <= 7 && field[i+1][j]  == '1' && field[i+2][j] == '1' && field[i+3][j] == '1'){
		 //縦一列
		 cout << "B" << endl;
	   }else if(j+1 <= 7 && i+1 <= 7 && field[i][j+1] == '1' && field[i+1][j] == '1' && field[i+1][j+1] == '1'){
		 //正方形
		 cout << "A" << endl;
	   }else if(i+2 <= 7 && j+1 <= 7 && field[i+1][j] == '1' && field[i+1][j+1]  == '1' && field[i+2][j+1] == '1'){
		 //1 0
		 //1 1
		 //0 1
		 cout << "F" << endl;
	   }else if(j-1 >= 0 && j+1 <= 7 && i+1 <= 7 && field[i][j+1] == '1' && field[i+1][j] == '1' && field[i+1][j-1] == '1'){
		 //0 1 1
		 //1 1 0
		 cout << "G" << endl;
	   }else if(j+2 <= 7 && i+1 <= 7 && field[i][j+1] == '1' && field[i+1][j+1]  == '1' && field[i+1][j+2] == '1'){
		 //1 1 0
		 //0 1 1
		 cout << "E" << endl;
	   }else{
		 cout << "D" << endl;
	   }
	   cin.clear();
	   cin.ignore();
	   if(cin.eof()) return 0;
	 }
	 return 0;
}

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

#define SIZE 8

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

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

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

C++: #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
#define int long long
vector<vector<int>> map(8,vector<int>(8,0));
bool ch(int y, int x){
	if (0<=x&&x<8&&0<=y&&y<8) return map[y][x]==1;
	else return false;
}
signed main(){
	char buf[256];
	int sx,sy;
	while( scanf("%s", buf) != EOF ){
		for(int j = 0; j < 8; j++){
			if(buf[j] == '1') map[0][j] = 1;
			else map[0][j] = 0;
		}
		for(int i = 1; i < 8; i++){
			scanf("%s", buf);
			for(int j = 0; j < 8; j++){
				if(buf[j] == '1') map[i][j] = 1;
				else map[i][j] = 0;
			}
		}
		int sx=-1,sy=-1;
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				if(map[i][j]==1){
					sx = j;
					sy = i;
					goto next;
				}
			}
		}
next:
		if(ch(sy,sx+1)&&ch(sy+1,sx)&&ch(sy+1,sx+1)) printf("A\n");
		else if(ch(sy+1,sx)&&ch(sy+2,sx)&&ch(sy+3,sx)) printf("B\n");
		else if(ch(sy,sx+1)&&ch(sy,sx+2)&&ch(sy,sx+3)) printf("C\n");
		else if(ch(sy+1,sx)&&ch(sy+1,sx-1)&&ch(sy+2,sx-1)) printf("D\n");
		else if(ch(sy,sx+1)&&ch(sy+1,sx+1)&&ch(sy+1,sx+2)) printf("E\n");
		else if(ch(sy+1,sx)&&ch(sy+1,sx+1)&&ch(sy+2,sx+1)) printf("F\n");
		else if(ch(sy,sx+1)&&ch(sy+1,sx)&&ch(sy+1,sx-1)) printf("G\n");
		else printf("error\n");
	}
	return 0;
}

C++: #include<cstdio>
#define REP(i,a,n) for(int i  = a;i < n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int in(){int n;scanf("%d",&n); return n;}
int main(void){
 int atlas[10][10];
 rep(i,8){

 return 0;
}