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>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int n;
    cin >> n;
    while(--n >= 0){
        vector<vector<int> > a(9, vector<int>(9));
        for(int i=0; i<9; ++i){
            for(int j=0; j<9; ++j){
                cin >> a[i][j];
            }
        }

        vector<vector<bool> > wrong(9, vector<bool>(9, false));
        for(int i=0; i<9; ++i){
            for(int j=0; j<9; ++j){
                for(int k=j+1; k<9; ++k){
                    if(a[i][j] == a[i][k])
                        wrong[i][j] = wrong[i][k] = true;
                    if(a[j][i] == a[k][i])
                        wrong[j][i] = wrong[k][i] = true;
                    int y1 = (i/3)*3 + (j/3);
                    int x1 = (i%3)*3 + (j%3);
                    int y2 = (i/3)*3 + (k/3);
                    int x2 = (i%3)*3 + (k%3);
                    if(a[y1][x1] == a[y2][x2])
                        wrong[y1][x1] = wrong[y2][x2] = true;
                }
            }
        }

        for(int i=0; i<9; ++i){
            for(int j=0; j<9; ++j){
                if(wrong[i][j])
                    cout << '*';
                else
                    cout << ' ';
                cout << a[i][j];
            }
            cout << endl;
        }

        if(n > 0)
            cout << endl;
    }
}

C++: #include<string>
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
  int a[9][9],n;
  bool OKNG[9][9];
  cin >> n;
  for(int i=0; i < n ;i++){
    for(int j=0;j<9;j++){
      for(int k=0;k<9;k++){
	cin >> a[j][k];
	OKNG[j][k]=true;
      }
    }
    for(int l=0;l < 9 ; l++){
      for(int j=0; j < 9; j++){
	for(int k=0;k < 9; k++){
	  if(a[l][j]==a[l][k]&&j!=k){
	    OKNG[l][j] = false;
	  }
	}
	for(int k=0;k < 9;k++){
	  if(a[l][j]==a[k][j]&&l!=k){
	    OKNG[l][j] = false;
	  }
	}
	int x=l/3,y=j/3;
	for(int k=x*3;k<x*3+3;k++){
	  for(int v=y*3;v<y*3+3;v++){
	    if(a[l][j]==a[k][v] && (l!=k&&j!=v)){
	      OKNG[l][j] = false;
	    }
	  }
	}
      }
    }

    for(int j=0;j<9;j++){
      for(int k=0;k<9;k++){
	if(OKNG[j][k]==true)cout << " ";
	else cout << "*";
	cout << a[j][k];
      }
      cout << endl;
    }
    if(i!=n-1)cout << endl;
  }
}

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


using namespace std;
/*
 入力1までの日数　−　入力2までの日数
*/


int main(){
    int n;
    cin>>n;
    for(int roop=0; roop<n; roop++){
        
        int puzzle[9][9];
        for(int i=0; i<9; i++){
            for(int j=0; j<9; j++){
                cin>>puzzle[i][j];
            }
        }
        
        char ans[9][9];        
        for(int i=0; i<9; i++){
            bool checker[10]={0};
            for(int j=0; j<9; j++){
                if(checker[puzzle[i][j]]==0){
                    checker[puzzle[i][j]]=true;
                    ans[i][j]=' ';
                }else{
                    for(int k=0; k<j; k++){
                        if(puzzle[i][j]==puzzle[i][k])ans[i][k]='*';
                    }
                    ans[i][j]='*';
                }
            }
        }
        
        for(int i=0; i<9; i++){
            bool checker[10]={0};
            for(int j=0; j<9; j++){
                if(checker[puzzle[j][i]]==0){
                    checker[puzzle[j][i]]=true;
                }else{
                    for(int k=0; k<j; k++){
                        if(puzzle[j][i]==puzzle[k][i]){
                            ans[k][i]='*';
                        }
                    }
                    ans[j][i]='*';
                }
            }
        }
        
        for(int i=0; i<9; i++){
            for(int j=0; j<9; j++){
                cout<<ans[i][j]<<puzzle[i][j];
            }
            cout<<endl;
        }
        
    }
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int m[9][9][2];
int main()
{
  int n,i,j,k;
  bool f = false;
  cin >> n;
  while(n--){
    memset(m,0,sizeof(m));
    if(f) cout << endl;
    for(i=0;i<9;i++){
      for(j=0;j<9;j++){
	cin >> k;
	m[i][j][0] = k;
	for(k=0;k<i;k++){
	  if(m[i][j][0] == m[k][j][0]){
	    m[i][j][1] = 1;
	    m[k][j][1] = 1;
	  }
	}
	for(k=0;k<j;k++){
	  if(m[i][j][0] == m[i][k][0]){
	    m[i][j][1] = 1;
	    m[i][k][1] = 1;
	  }
	}
      }
    }
    for(i=0;i<9;i++){
      for(j=0;j<9;j++){
	if(m[i][j][1] == 1) cout << "*";
	else cout << " ";
	cout << m[i][j][0];
      }
      cout << endl;
    }
    f = true;
  }
  return 0;
}