Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	scanner.Split(bufio.ScanWords)
	for scanner.Scan() {
		table := [9][9]int{}
		check := [9][9]bool{}
		n, _ := strconv.Atoi(scanner.Text())
		for n > 0 {
			n--
			for i := 0; i < 9; i++ {
				for j := 0; j < 9; j++ {
					table[i][j] = nextInt()
				}
			}
			for i := 0; i < 9; i++ {
				for j := 0; j < 9; j++ {
					ok := true
					for k := 0; k < 9; k++ {
						if table[i][j] == table[i][k] && j != k {
							ok = false
						}
					}
					for k := 0; k < 9; k++ {
						if table[i][j] == table[k][j] && i != k {
							ok = false
						}
					}
					seci := i/3
					secj := j/3
					for k := 0; k < 3; k++ {
						for l := 0; l > 3; l++ {
							if table[seci*3+k][secj*3+l]==table[i][j]&&seci*3+k!=i&&secj*3+l!=j {
								ok = false
							}
						}
					}
					if !ok {
						check[i][j] = true
					}
				}
			}
			for i := 0; i < 9; i++ {
				for j := 0; j < 9; j++ {
					if check[i][j] {
						fmt.Print("*")
					} else {
						fmt.Print(" ")
					}
					fmt.Print(table[i][j])
				}
				fmt.Println()
			}
			if n != 0 {
				fmt.Println()
			}
		}
	}
}

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
  int n;
  cin>>n;
  rep(a,n){
    int dt[10][10];
    int checkline[10][10];
    int checkrow[10][10];
    rep(i,10){
      rep(j,10){
	checkline[i][j]=0;
	checkrow[i][j]=0;
      }
    }
    loop(i,1,10){
      loop(j,1,10){
	cin>>dt[i][j];
	checkline[i][dt[i][j]]++;//横ライン見てる
	checkrow[j][dt[i][j]]++;//縦ライン見てる
      }
    }
    bool error[10][10];
    rep(i,10)rep(j,10)error[i][j]=false;
    rep(i,10){
      rep(j,10){
	if(checkline[i][j]>1){
	  rep(k,10){
	    if(dt[i][k]==j)error[i][k]=true;
	  }
	}
      }
    }
    rep(j,10){
      rep(i,10){
	if(checkrow[j][i]>1){
	  rep(k,10){
	    if(dt[k][j]==i)error[k][j]=true;
	  }
	}
      }
    }
    int circle[4][4][10];
    rep(i,4)rep(j,4)rep(k,10)circle[i][j][k]=0;
    loop(i,1,4){
      loop(j,1,4){
	for(int k=(i-1)*3+1;k<(i-1)*3+4;k++){
	  for(int l=(j-1)*3+1;l<(j-1)*3+4;l++){
	    circle[i][j][dt[k][l]]++;
	  }
	}
	for(int k=1;k<10;k++){
	  if(circle[i][j][k]>1){
	    for(int l=(i-1)*3+1;l<(i-1)*3+4;l++){
	      for(int m=(j-1)*3+1;m<(j-1)*3+4;m++){
		if(dt[l][m]==k)error[l][m]=true;
	      }
	    }
	  }
	}
      }
    }
    loop(i,1,10){
      loop(j,1,10){
	if(error[i][j])cout<<"*"<<dt[i][j];
	else cout<<" "<<dt[i][j];
      }
      cout<<endl;
    }
    if(a!=n-1)cout<<endl;
  }
  return 0;
}

C++: #include <stdio.h>
int a[9][9];
void check(int x,int y){
    for(int i=0;i<9;i++){
        if(a[i][y]==a[x][y]&&i!=x){
            printf("*%d",a[x][y]);
            return;
        }
    }
    for(int i=0;i<9;i++){
        if(a[x][i]==a[x][y]&&i!=y){
            printf("*%d",a[x][y]);
            return;
        }
    }
    for(int i=x-x%3;i<x-x%3+3;i++){
        for(int j=y-y%3;j<y-y%3+3;j++){
            if(a[i][j]==a[x][y]&&(i!=x||j!=y)){
                printf("*%d",a[x][y]);
                return;
            }
        }
    }
    printf(" %d",a[x][y]);
    return;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        if(i>0)printf("\n");
        for(int j=0;j<9;j++){
            for(int k=0;k<9;k++){
                scanf("%d",&a[j][k]);
            }
        }
        for(int j=0;j<9;j++){
            for(int k=0;k<9;k++){
                check(j,k);
            }
            printf("\n");
        }
    }
}

C++: #include <vector>
#include <map>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
using namespace std;
typedef long long  ll;

/** Problem0126 : Puzzle **/
int main()
{
	int board[9][9];
	bool wrong[9][9];
	int n;
	
	cin >> n;
	rep(k, n) {
		rep(y, 9) rep(x, 9)  {
			cin >> board[x][y]; board[x][y]--;
			wrong[x][y] = false;
		}

		int use[9];
		
		rep(i, 9) {
			// 横
			fill(use, use+9, -1);
			rep(j, 9) {
				int num = board[j][i];
				if (use[num]>=0) {
					wrong[j][i] = true;
					wrong[use[num]][i] = true;
				} else {
					use[num] = j;
				}
			}
			// 縦
			fill(use, use+9, -1);
			rep(j, 9) {
				int num = board[i][j];
				if (use[num]>=0) {
					wrong[i][j] = true;
					wrong[i][use[num]] = true;
				} else {
					use[num] = j;
				}
			}
			// 斜め
			fill(use, use+9, -1);
			int sx = (i%3)*3, sy = (i/3)*3;
			rep(ii, 3) {
				rep(jj, 3) {
					int num = board[sx+jj][sy+ii];
					if (use[num]>=0) {
						wrong[sx+jj][sy+ii] = true;
						wrong[sx+use[num]%3][sy+use[num]/3] = true;
					} else {
						use[num] = ii*3+jj;
					}
				}
			}
		}
		
		rep(y, 9) {
			rep(x,9) {
				if (wrong[x][y]) {
					cout << '*';
				} else {
					cout << ' ';
				}
				cout << ++board[x][y];
			}
			cout << endl;
		}
		if (k<n-1)
			cout << endl;
	}
	return 0;
}

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

int main(){
	int n, f = 0;
	std::cin >> n;
	while(n--){
		if(f++)std::cout << "\n";
		int sudoku[9][9], map[9][9];
		memset(map, 0, sizeof(map));
		for(int i=0;i<81;i++)
			std::cin >> sudoku[i/9][i%9];
		
		int check[10][2];

		for(int i=0;i<9;i++){
			memset(check, -1, sizeof(check));
			for(int j=0;j<9;j++){
				int x = check[sudoku[i][j]][1],
					y = check[sudoku[i][j]][0];
				if(x != -1){
					map[y][x] = 1;
					map[i][j] = 1;
				}
				
				check[sudoku[i][j]][0] = i;
				check[sudoku[i][j]][1] = j;
			}
		}
		
		for(int i=0;i<9;i++){
			memset(check, -1, sizeof(check));
			for(int j=0;j<9;j++){
				int x = check[sudoku[j][i]][1],
					y = check[sudoku[j][i]][0];
				if(x != -1){
					map[y][x] = 1;
					map[j][i] = 1;
				}
				
			check[sudoku[j][i]][0] = j;
			check[sudoku[j][i]][1] = i;
			}
		}
		
		for(int i=0;i<9;i++){
			int sx = i % 3, sy = i / 3;//¶ãÌî_
			memset(check, -1, sizeof(check));
			for(int j=0;j<3;j++){
				for(int k=0;k<3;k++){
					int x = check[sudoku[sy*3+j][sx*3+k]][1],
						y = check[sudoku[sy*3+j][sx*3+k]][0];
					if(x != -1){
						map[y][x] = 1;
						map[sy*3+j][sx*3+k] = 1;
					}
					
					check[sudoku[sy*3+j][sx*3+k]][0] = sy*3+j;
					check[sudoku[sy*3+j][sx*3+k]][1] = sx*3+k;
				}
			}
		}
		
		for(int i=0;i<9;i++){
			for(int j=0;j<9;j++){
				if(map[i][j])
					std::cout << "*" << sudoku[i][j];
				else
					std::cout << " " << sudoku[i][j];
			}
			std::cout << "\n";
		}
	}
        return 0;
}

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

using namespace std;

int pzl[9][9];

bool check(int y, int x)
{
  for(int i = 0; i < 9; i++){
    if(x == i) continue;
    if(pzl[y][x] == pzl[y][i]) return false;
  }
  for(int i = 0; i < 9; i++){
    if(y == i) continue;
    if(pzl[y][x] == pzl[i][x]) return false;
  }
  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 3; j++){
      if(y == y/3*3+i && x == x/3*3+j) continue;
      if(pzl[y][x] == pzl[y/3*3+i][x/3*3+j]) return false;
    }
  }
  return true;
}

int main()
{
  int n;
  cin >> n;
  for(int l = 0; l < n; l++){
    if(l > 0) cout << endl;
    for(int i = 0; i < 9; i++){
      for(int j = 0; j < 9; j++){
	cin >> pzl[i][j];
      }
    }
    for(int i = 0; i < 9; i++){
      for(int j = 0; j < 9; j++){
	if(check(i, j)) cout << ' '; 
	else cout << '*';
	cout << pzl[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}