#include #include #include using namespace std; int array[9]; void toArray(string a); bool checkUsed(int a); void shift(); void toArray(string a) { for (int i=0; i<9; i++) array[i]=(a[i]-'0'); } bool checkUsed(int a) { for (int i=0; i<9; i++) if (array[i]==a) return true; return false; } void shift() { int temp[3]; temp[0]=array[0]; temp[1]=array[1]; temp[2]=array[2]; for (int i=0; i<6; i++) array[i]=array[i+3]; for (int i=0; i<3; i++) array[i+6]=temp[i]; } int main (int argc, char * const argv[]) { string str; cout<<"Enter the line of Sudoku: "; cin>>str; toArray(str); for (int i=1; i<=9; i++) if(!checkUsed(i)) for (int j=0; j<9; j++) if (array[j]==0) { array[j]=i; j=9; } for (int row=0; row<3; row++) { for (int i=0; i<9; i++) cout<