Language: C++

1#include<stdio.h>
#define N 8
#define FREE -1
#define NOT_FREE 1
#define FALSE 0
#define TRUE 1
int row[N],col[N],dpos[2*N -1],dneg[2*N-1];
int X[N][N];

void initialize(){
  int i;
  for(i=0;i<N;i++){
    row[i]=0;
    col[i]=0;
  }
  for(i=0;i<2*N-1;i++){
    dpos[i]=FREE;
    dneg[i]=FREE;
  }
}
void print(){
  int i;
  int j;
  for(i=0;i<N;i++){
    for(j=0;j<N;j++)
      {
	if(X[i][j]!=0){
	  if(row[i]!=j) return ;
	}
      }
  }
  for(i=0;i<N;i++){
    for(j=0;j<N;j++){
      if(row[i]==j)printf("Q");
      else printf(".");
    }
    printf("\n");
  }
  }
void recursive(int i){
  int j;
   if(i==N){
     print();
    return ;
   }
     for(j=0;j<N;j++){
    if(col[j] == NOT_FREE||dpos[i+j]==NOT_FREE||dneg[i-j+N-1]==NOT_FREE)continue;
    row[i]=j;
    col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE;
    recursive(i+1);
    col[j]=dpos[i+j]=dneg[i-j+N-1]=FREE;
    
  }
}
int main(){
  int i,j;
  int k,r,c;
  initialize();//?????????
  for(i=0;i<N;i++)
    for(j=0;j<N;j++)
      X[i][j]=FALSE;
      scanf("%d",&k);
      for(i=0;i<k;i++){
	scanf("%d%d",&r,&c);
	X[r][c]=TRUE;
      }
      recursive(0);
      return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | 1#include<stdio.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1#include<stdio.h>
      | ^
a.cc: In function 'void initialize()':
a.cc:13:5: error: 'row' was not declared in this scope
   13 |     row[i]=0;
      |     ^~~
a.cc:14:5: error: 'col' was not declared in this scope
   14 |     col[i]=0;
      |     ^~~
a.cc:17:5: error: 'dpos' was not declared in this scope
   17 |     dpos[i]=FREE;
      |     ^~~~
a.cc:18:5: error: 'dneg' was not declared in this scope
   18 |     dneg[i]=FREE;
      |     ^~~~
a.cc: In function 'void print()':
a.cc:28:14: error: 'row' was not declared in this scope
   28 |           if(row[i]!=j) return ;
      |              ^~~
a.cc:34:10: error: 'row' was not declared in this scope
   34 |       if(row[i]==j)printf("Q");
      |          ^~~
a.cc:34:20: error: 'printf' was not declared in this scope
   34 |       if(row[i]==j)printf("Q");
      |                    ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | 1#include<stdio.h>
a.cc:35:12: error: 'printf' was not declared in this scope
   35 |       else printf(".");
      |            ^~~~~~
a.cc:35:12: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:37:5: error: 'printf' was not declared in this scope
   37 |     printf("\n");
      |     ^~~~~~
a.cc:37:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc: In function 'void recursive(int)':
a.cc:47:8: error: 'col' was not declared in this scope
   47 |     if(col[j] == NOT_FREE||dpos[i+j]==NOT_FREE||dneg[i-j+N-1]==NOT_FREE)continue;
      |        ^~~
a.cc:47:28: error: 'dpos' was not declared in this scope
   47 |     if(col[j] == NOT_FREE||dpos[i+j]==NOT_FREE||dneg[i-j+N-1]==NOT_FREE)continue;
      |                            ^~~~
a.cc:47:49: error: 'dneg' was not declared in this scope
   47 |     if(col[j] == NOT_FREE||dpos[i+j]==NOT_FREE||dneg[i-j+N-1]==NOT_FREE)continue;
      |                                                 ^~~~
a.cc:48:5: error: 'row' was not declared in this scope
   48 |     row[i]=j;
      |     ^~~
a.cc:49:5: error: 'col' was not declared in this scope
   49 |     col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE;
      |     ^~~
a.cc:49:12: error: 'dpos' was not declared in this scope
   49 |     col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE;
      |            ^~~~
a.cc:49:22: error: 'dneg' was not declared in this scope
   49 |     col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE;
      |                      ^~~~
a.cc: In function 'int main()':
a.cc:62:7: error: 'scanf' was not declared in this scope
   62 |       scanf("%d",&k);
      |       ^~~~~