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)
		fmt.Scanln()
	}
}

C++: #include<iostream>
#include<vector>
#define MAX  999999
bool prime[MAX];
using namespace std;

int main(void){
  int n ;
  
  vector<int> dp(0,0);
  //isPrime();

  fill(prime,prime+MAX,true);
  int cnt = 0;
  prime[0]=prime[1]=false;
  for(int i = 2 ; i < MAX ; i ++){
    if(prime[i]){
      cnt += i;
      for(int j = 2 ; j * i < MAX ; j ++){
        prime[i*j] = false;
      }
    dp.push_back(cnt);
    }
  }  
  
  
  while(cin>>n,n)
  cout<<dp[n-1]<<endl;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

char judge( vector<string> surface )
{
	for ( unsigned int i = 0; i < surface.size(); i++ )
	{
		for ( unsigned int j = 0; j < surface[i].length(); j++ )
		{
			if ( surface[i][j] == '1' )
			{
				// A
				if ( surface[i][j+1] == '1' && surface[i+1][j] == '1' && surface[i+1][j+1] == '1' )
				{
					return 'A';
				}
				// B
				else if ( surface[i+1][j] == '1' &&surface[i+2][j] == '1' &&surface[i+3][j] == '1' )
				{
					return 'B';
				}
				// C
				else if ( surface[i][j+1] == '1' && surface[i][j+2] == '1' && surface[i][j+3] == '1' )
				{
					return 'C';
				}
				// D
				else if ( surface[i+1][j] == '1' && surface[i-1][j-1] == '1' && surface[i-2][j-1] == '1' )
				{
					return 'D';
				}
				// E
				else if ( surface[i][j+1] == '1' && surface[i+1][j+1] == '1' && surface[i+1][j+2] == '1' )
				{
					return 'E';
				}
				// F
				else if ( surface[i+1][j] == '1' && surface[i+1][j+1] == '1' && surface[i+2][j+1] == '1' )
				{
					return 'F';
				}
				// G
				else if ( surface[i+1][j+1] == '1' && surface[i-1][j-1] == '1' && surface[i+1][j] == '1' )
				{
					return 'G';
				}
				else
				{
					return '-';
				}
			}
		}
	}

	return '-';
}

int main()
{
	while ( true )
	{
		string buffer;
		vector<string> surface;

		surface.push_back( "00000000000000" );
		surface.push_back( "00000000000000" );
		surface.push_back( "00000000000000" );

		for ( int i = 0; i < 8; i++ )
		{
			if ( cin >> buffer )
			{
				surface.push_back( "000" + buffer + "000" );
			}
			else
			{
				return 0;
			}
		}

		surface.push_back( "00000000000000" );
		surface.push_back( "00000000000000" );
		surface.push_back( "00000000000000" );

		cout << judge( surface ) << endl;
	}
	
	return 0;
}

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

int main() {

  int map[14][14] = {0};
  char input;

  while(true) {

    bool flag = false;
    for ( int i = 3; i < 11; i++ ) {

      for ( int j = 3; j < 11; j++ ) {

	cin >> input;
	if ( cin.eof() ) {
	  flag = true;
	  break;
	}
	map[j][i] = input - '0';

      }
      if ( flag ) break;

    }
    if ( flag ) break;

    for ( int i = 3; i < 11; i++ ) {
      for ( int j = 3; j < 11; j++ ) {

	if ( map[j][i] != 0 ) {
	  if ( map[j][i+3] != 0 ) {
	    cout << "B";
	  }else if ( map[j+3][i] != 0 ) {
	    cout << "C";
	  }else if ( map[j-1][i+2] != 0 ) {
	    cout << "D";
	  }else if ( map[j+2][i+1] != 0 ) {
	    cout << "E";
	  }else if ( map[j+1][i+2] != 0 ) {
	    cout << "F";
	  }else if ( map[j-1][i+1] != 0 ) {
	    cout << "G";
	  }else {
	    cout << "A";
	  }
	  cout << endl;
	  flag = true;
	  break;
	}

      }
      if ( flag ) break;
    }

  }

  return 0;

}