criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <math.h>

struct Pair {
    int first;
    int second;
};
Pair pii[10005];
int N, answer;
bool isPrime(int n) {
    if (n == 1) return 0;
    if (n == 2) return 1;
    int i;
    for (i = 2; i <= sqrt(n); i ++)
        if (n % i == 0) return false;
    return true;
}
int main() {
    while (scanf("%d", &N) != EOF) {
        answer = 0;
        int i;
        for (i = 1; i <= N; i ++) {
            pii[i].first = i;
            pii[i].second = N - i + 1;
        }
        for (i = 1; i <= N; i ++) {
            if (isPrime(pii[i].first) && isPrime(pii[i].second))
                answer ++;
        }
        printf("%d\n", answer);
    }
    return 0;
}

Compiler output:
main.c:8:1: error: unknown type name 'Pair'; use 'struct' keyword to refer to the type
    8 | Pair pii[10005];
      | ^~~~
      | struct 
main.c:10:1: error: unknown type name 'bool'
   10 | bool isPrime(int n) {
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c: In function 'isPrime':
main.c:15:32: error: 'false' undeclared (first use in this function)
   15 |         if (n % i == 0) return false;
      |                                ^~~~~
main.c:15:32: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:15:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:12: error: 'true' undeclared (first use in this function)
   16 |     return true;
      |            ^~~~
main.c:16:12: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:23:19: error: request for member 'first' in something not a structure or union
   23 |             pii[i].first = i;
      |                   ^
main.c:24:19: error: request for member 'second' in something not a structure or union
   24 |             pii[i].second = N - i + 1;
      |                   ^
main.c:27:31: error: request for member 'first' in something not a structure or union
   27 |             if (isPrime(pii[i].first) && isPrime(pii[i].second))
      |                               ^
main.c:27:56: error: request for member 'second' in something not a structure or union
   27 |             if (isPrime(pii[i].first) && isPrime(pii[i].second))
      |                                                        ^
Language: C

#include<stdio.h>
int gcd(int a,int b){
if(b==0) return a;
else return gcd(b,a%b);
}
int main(void){
int i,n;
while(scanf("%d",&n)!=EOF){
    count=0;
    for(i=0;i<n;i++){
        if(gcd(i,n-i)==1) count++;
    }
    printf("%d\n",count);
}
return 0;}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: 'count' undeclared (first use in this function)
    9 |     count=0;
      |     ^~~~~
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<bits/stdc++.h>
#define M 10005
using namespace std;
int fac[M];
void sieve()
{
	fac[0]=fac[1]=1;
	int i,j;
	for(i=2;i*i<M;i++)
	{
        if(!fac[i])
		{
			for(j=i*i;j<M;j+=i)
				if(!fac[j])
				{
					fac[j]=1;
					
				}	
		}
	}

}
int main()
{
	sieve();
	
	int x;
	scanf("%d",&x);
	while(x--)
	{
		int n,i,ans=0;
		scanf("%d",&n);
		
		for(i=1;i<=n;i++)
		{
			if(!fac[i]&&!fac[n-i+1])
				ans++;
		}
		printf("%d\n",ans);
	}
	
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

import java.util.HashSet;
import java.util.Scanner;

class Main {
    public static HashSet<Integer> hs = new HashSet<>();
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()) {
            int count = 0;
            int n = in.nextInt();
            int a[] = new int[n];
            int b[] = new int[n];
            for(int i = 0; i < n; i++) {
                a[i] = i+1;
                b[i] = n-i;
            }
            sieveOfEratosthenes(n);
            for(int i = 0; i < n; i++)
                if(hs.contains(a[i]) && hs.contains(b[i]))
                    count++;
            System.out.println(count);
        }
    }
    static void sieveOfEratosthenes(int n) {
        long prime[] = new long[n + 1];

        for (int p = 2; p * p <= n; p++)
            if (prime[p] == 0)
                for (int i = p * 2; i <= n; i += p)
                    prime[i] = 1;

        for (int i = 2; i <= n; i++)
            if (prime[i] == 0)
                hs.add(i);
    }
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.HashSet;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.HashSet;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Scanner;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'class'
    4 | class Main {
      | ^~~~~
main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    4 | class Main {
      |            ^
Language: C

#include <stdio.h>
int prime( int a ) {
int j=0;
while (j*j < a ) {
if( a % j == 0 ) return 0;
}
return 1;
}
int main() {
int in , i , count;
while (1) {
count = 0;
in=scanf("%d",in);
if( in == EOF ) berak;
for ( i = 1; i <= in / 2 + 1; in--,i++) {
if ( prime(in+i) ) count++;
}
printf("%d\n",count*2);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:17: error: 'berak' undeclared (first use in this function)
   14 | if( in == EOF ) berak;
      |                 ^~~~~
main.c:14:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include	<math.h>
#include	<stdio.h>

int primaryCheck(int num){
	int i, max = sqrt(num);
	if(num == 1)	return 0;
	if(num == 2)	return 1;
	if(num %2 == 0)	return 0;
	
	for(i = 3; i <= max; i+= 2){
		if(num % i == 0)	return 0;
	} 
	
	return 1;
}


int main(int argc, char** argv){

	int i, x, cnt = 0;

	scanf("%d", &x);
	
	for(i = 1; i <= x; i++){
	if(primaryCheck(i) && primaryCheck(x - i + 1)){
		cnt++;
	}
	
	
	printf("%d\n", cnt);

	return 0;	
}

Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}
int main() {
	int N;
	while (cin >> N, N) {
		int cnt - 0;
		for (int i = 1; i <= N; i++) {
			if (prime(i) && prime(N - i + 1))
				cnt++;
		}
		cout << cnt << endl;
	}
}





Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: expected initializer before '-' token
   17 |                 int cnt - 0;
      |                         ^
a.cc:20:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |                                 cnt++;
      |                                 ^~~
      |                                 int
a.cc:22:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   22 |                 cout << cnt << endl;
      |                         ^~~
      |                         int
Language: C++

#include <iostream>
#define LEN 10000

using namespace std;
int prime_pair(int N);
int is_prime(int p);
int prime_list(int MAX);
int prime[LEN];

int main(void){
	int input;
    int j = 0;
    prime_list(LEN);
    while(cin >> input){
        cout << prime_pair(input) << endl;
	}
	return 0;
}

int prime_list(int MAX){
    int i = 0;
    int j = 0;
    int flag = 1;
    prime[0] = 2;
    for(i = 2; i < MAX; i++){
        while(prime[j] != 0){
            if(i % prime[j] == 0){
                flag = 0;
            }
            j++;
        }
        if(flag){
            prime[j] = i;
        }
        flag = 1;
        j=0;
    }
    return 0;
}

int prime_pair(int N){
    int count = 0;
    if(is_prime(2) && is_prime(N-2+1))count++;
    for(int i = 3; i <= N/2; i = i+2){
        if(is_prime(i) && is_prime(N-i+1))count++;
    }
    return count*2;
}

int is_prime(int p){
    int flag = 0;
    int i = 0;
    while((prime[i] != 0) && (i < p)){
        if(p == prime[i]){
            flag = 1;
            break;
        }
        i++;
    }
    return flag

Compiler output:
a.cc: In function 'int is_prime(int)':
a.cc:60:16: error: expected ';' at end of input
   60 |     return flag
      |                ^
      |                ;
a.cc:60:16: error: expected '}' at end of input
a.cc:50:20: note: to match this '{'
   50 | int is_prime(int p){
      |                    ^
Language: C++

#include <iostream>
#define LEN 10001

using namespace std;
int prime_pair(int N);

int main(void){
	int input;
    int count;
    bool prime[LEN] = {0};
    prime[0] = 1;
    prime[1] = 1;
    for(int i = 2; i*i < MAX; i++){
        for(int j = i*2; j < MAX; j += i){
            prime[j] = 1;
        }
    }
    while(cin >> input){
        count = 0;
        for(int i = 1; i <= N; i++){
            if((!prime[i]) && (!prime[N-i+1])) count++;
        }
        cout << prime_pair(input) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: 'MAX' was not declared in this scope
   13 |     for(int i = 2; i*i < MAX; i++){
      |                          ^~~
a.cc:20:29: error: 'N' was not declared in this scope
   20 |         for(int i = 1; i <= N; i++){
      |                             ^
Language: C++

#include <iostream>
#define LEN 10001

using namespace std;

int main(void){
	int N;
    int count;
    bool prime[LEN] = {0};
    prime[0] = 1;
    prime[1] = 1;
    for(int i = 2; i*i < LEN; i++){
        for(int j = i*2; j < LEN; j += i){
            prime[j] = 1;
        }
    }
    while(cin >> N){
        count = 0;
        for(int i = 1; i <= N; i++){
            if((!prime[i]) && (!prime[N-i+1])) count++;
        }
        cout << prime_pair(input) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: 'input' was not declared in this scope; did you mean 'int'?
   22 |         cout << prime_pair(input) << endl;
      |                            ^~~~~
      |                            int
a.cc:22:17: error: 'prime_pair' was not declared in this scope
   22 |         cout << prime_pair(input) << endl;
      |                 ^~~~~~~~~~
Language: C++

#include <iostream>

#define NMAX (10000)

using namespace std;

bool prime[NMAX] = {true};

int main() {
	prime[0] = prime[1] = false;
	for(int i=3; i<NMAX; i+=2) {
		if(prime[j]) {
			int j = i*2;
			while(j<NMAX) {
				prime[j] = false;
				j += j;
			}
		}
	}
	
	for(int i; cin >> i;) {
		int ans = 0;
		for(int j=1; j<i; j++) {
			if(prime[j] && prime[i+1-j]) ans++;
		cout << ans << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: 'j' was not declared in this scope
   12 |                 if(prime[j]) {
      |                          ^
a.cc:13:29: error: redeclaration of 'int j'
   13 |                         int j = i*2;
      |                             ^
a.cc:12:26: note: '<typeprefixerror>j' previously declared here
   12 |                 if(prime[j]) {
      |                          ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std; 
void main()
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    cin>>n;
    for (int p=2; p*p<=n; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }

int c=0;
for (int p=2; p<=n; p++)
{
        if (prime[p]==prime[n-p-1])
       {
          c++;
}  }
 cout<<c;
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     bool prime[n+1];
      |                ^
      |                yn
a.cc:9:12: error: 'prime' was not declared in this scope
    9 |     memset(prime, true, sizeof(prime));
      |            ^~~~~
Language: C++

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstring;
typedef pair<int, int> pint;
typedef pair<pint, int> ppint;
typedef pair<int, pint> pintp;
typedef unsigned int uint;
typedef long long llint;
typedef unsigned long long int ullint;

//container util
//------------------------------------------
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find((v).begin(), (v).end(), i) != (v).end())
#define ERASE(v,i) (v).erase(remove((v).begin(),(v).end(),i),(v).end())
#define me (*this)

//repetition
//------------------------------------------
#define rep(i,s) for(int i=0; i<(int)(s); i++)

//constant
//--------------------------------------------
const int INF = 100000000;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLEAR(a) memset((a), 0 ,sizeof(a))

//debug
#define debug(x)  cerr << #x << " = " << (x) << endl

bitset<10001> prime;

void makePrimeList() {
	prime.set();
	prime.at(0) = prime.at(1) = false;
	for(int i = 2; i * i <= 10000; i++)
		if(prime[i])
			for(int j = 2; i * j <= 10000; j++)
				prime[i * j] = false;
}

int main() {
	makePrimeList();
	static int n;
	while(cin >> n) {
		vint ary(n);
		for(int i = 1; i <= n; i++)
			ary[i - 1] = i;
		vint rary = ary;
		reverse(all(rary));
		int ans = 0;
		rep(i,n) {
			if(prime[ary[i]] == true && prime[rary[i]] == true)
				ans++;
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void makePrimeList()':
a.cc:73:15: error: 'class std::bitset<10001>' has no member named 'at'
   73 |         prime.at(0) = prime.at(1) = false;
      |               ^~
a.cc:73:29: error: 'class std::bitset<10001>' has no member named 'at'
   73 |         prime.at(0) = prime.at(1) = false;
      |                             ^~
Language: C++

import java.util.Scanner;

public class Main{
    boolean[] prm;
    final int mx = 10001;

    void mkPrm(){
	prm = new boolean[mx];
	for(int i = 0; i < mx; i++) prm[i] = true;
	prm[0] = prm[1] = false;

	for(int i = 0; i < mx; i++)
	    if(prm[i])
		for(int j = i+i; j < mx; j+=i) prm[j] = false;

	return ;
    }

    Main(){
	Scanner sc = new Scanner(System.in);
	mkPrm();

	while(sc.hasNext()){
	    int n = sc.nextInt(), cnt = 0;

	    for(int i = 0; i < n; i++)
		if(prm[i+1] && prm[n-i]) cnt++;

	    System.out.println(String.valueOf(cnt));
	}
    }

    public static void main(String[] args){
	new Main();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

//============================================================================
// Name        : TopCoderCompetition.cpp
// Author      : taguchi
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <bitset>
#include <algorithm>
#include <map>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <numeric>
#include <list>
#include <sstream>
using namespace std;
//#define P pair<int,int>
//#define max 999999
typedef unsigned int uint;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,n) for(ull i = 0;i<n;i++)
#define pb(n) push_back(n)
#define clear(n) memset(n,0,sizeof(n))

typedef vector<int> vi;
typedef vector<string> vs;
struct edge{int cost,to;};

vector<string> split(string &in,char delimiter){
	vector<string> re; uint cur = 0,next;
	while((next = in.find_first_of(delimiter,cur)) != string::npos){
		re.pb(string(in,cur,next-cur));
		cur = next + 1;
	}
	re.pb(string(in,cur,in.size()-cur));
	return re;
}
vector<int> split_int(string &in, char delimiter){
	vector<string> str = split(in,delimiter);
	vector<int> re;
	rep(i,str.size()){
		re.pb(strtol(str[i].c_str(),NULL,10));
	}
	return re;
}

class Range{
public:
	int a,b;
	Range(int an,int bn) : a(an),b(bn){}

	bool operator()(int n){
		return a<=n&&n<=b;
	}
	bool isCross(Range x){
		return x(a) || x(b);
	}
	bool contains(Range x){
		return this->a <= x.a && x.b <= this->b;
	}
};

bool isnprime[10010];
uint indexpri[10010];
int main(){
	int cnt = 0;
	for(int i = 2;i<10010;i++){
		if(!isnprime[i]){
			indexpri[cnt++] = i;
			for(int j = 2;i*j<10010;j++){
				isnprime[i*j] = true;
			}
		}
	}
	isnprime[0] = true;isnprime[1] = true;
	//while(1){
		int n;
		uint result = 0;
		cin >> n;
		if(!n)break;
		for(int i = 0;i<cnt;i++){
			if(n-indexpri[i]+1 < 2)break;
			if(binary_search(indexpri,indexpri+cnt,n-indexpri[i] + 1)) result++;
		}
		cout << result << endl;
	//}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:23: error: break statement not within loop or switch
   88 |                 if(!n)break;
      |                       ^~~~~
Language: C++

#include <cstdlib>
#include <iostream>

using namespace std;
  

int main(int argc, char *argv[])
{
    int pri[10001] ;
    int i , j , n ,count=0;
    memset(pri , 0 , sizeof( pri ) ) ;  
    for( i = 2 ; i < 10001 ; i ++ )        
    {  
       if( pri[i] == 0 )  
       {  
           for( j = 2 ; i * j < 10001 ; j ++ )  
           {  
              pri[i*j] = 1 ;  
           }  
       }  
    }
  //  for(i=0;i<100;i++)
    //    {cout<<pri[i]<<" ";if(i%10==0)cout<<endl;}
    while(cin>>n)
    {
        for(i=2;i<=(1+n)/2;i++)if( !pri[i] && !pri[n-i+1] )count++;
        if( (n%2==1) && !pri[(1+n)/2] && n>1) cout<<(2*count+1)<<endl;
        else                           cout<<2*count<<endl;
        count=0;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:11:5: error: 'memset' was not declared in this scope
   11 |     memset(pri , 0 , sizeof( pri ) ) ;
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <iostream>
using namespace std;
int main()
{
    int pri[10001] ;
    int i , j , n ,count=0;
    memset(pri , 0 , sizeof( pri ) ) ;  
    for( i = 2 ; i < 10001 ; i ++ )       
    {  
       if( pri[i] == 0 )  
       {  
           for( j = 2 ; i * j < 10001 ; j ++ )  
           {  
              pri[i*j] = 1 ;  
           }  
       }  
    }
    while(cin>>n)
    {
        for(i=2;i<=(1+n)/2;i++)if( !pri[i] && !pri[n-i+1] )count++;
        if( (n%2==1) && !pri[(1+n)/2] && n>1) cout<<(2*count+1)<<endl;
        else                           cout<<2*count<<endl;
        count=0;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'memset' was not declared in this scope
    7 |     memset(pri , 0 , sizeof( pri ) ) ;
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <cstdio>
bool num[10005]={};
int n;
int main(){
    num[0]=num[1]=true;
    for(int i=2;i<=10005;i++){
        if(!num[i]){
            for(int j=2;j*i<=10000;j++){
                num[i*j]=true;
            }
        }
    }
    while(scanf("%d",&n){
int ans=0;
    for(int i=1;i<=n;i++){
        if(!num[i] && !num[n+1-i]) ans++;
     }
printf("%d\n",ans);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected ')' before '{' token
   13 |     while(scanf("%d",&n){
      |          ~              ^
      |                         )
Language: C++

#include <iostream>
using namespace std;

bool solve[10001];

void prime(){
  memset(solve,true,sizeof(solve));
  for(int i=2;i<=5000;i++){
    for(int j=2;i*j<=10000;j++) solve[i*j] = false;
  }
}


int main(){
  prime();
  int n;
  while(cin >> n){
    int cnt = 0;
    for(int i=2;i<n;i++){
      if(solve[i] && solve[n-i+1]) cnt++;
    }
    cout << cnt << endl;
  }
}

Compiler output:
a.cc: In function 'void prime()':
a.cc:7:3: error: 'memset' was not declared in this scope
    7 |   memset(solve,true,sizeof(solve));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<cstdlib>
using namespace std;

bool is_prime(int p){
	if(p<=1)return false;
	if(p==2)return true;
	if(!(p&1))return false;
	for(int x=3;x<=sqrt(p);++x) if(!(p%x))return false;
	return true;
}

int main(){
	bool primes[10002];
	memset(primes,0,sizeof(primes));
	for(int x=2;x<=10000;++x)if(is_prime(x))primes[x]=true;
	int n;
	while(scanf("%d",&n)==1,n){
		int c =0 ;
		int l = n/2;
		if(n%2==1){
			++l;--c;
		}
		for(int x=1;x<=l;++x){
			if(primes[x] && prime[n-x+1])c +=2;
		}
		cout<<c<<endl;
	}
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:41: error: 'prime' was not declared in this scope; did you mean 'primes'?
   40 |                         if(primes[x] && prime[n-x+1])c +=2;
      |                                         ^~~~~
      |                                         primes
Language: Java

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			if(n == 0){
				break;
			}
			int[][] students = new int[n][n];
			boolean[][] tallest = new boolean[n][n];
			boolean[][] shortest = new boolean[n][n];
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					students[i][j] = sc.nextInt();
				}
			}
			for(int i = 0; i < n; i++){
				int rowMin = Integer.MAX_VALUE, columnMax = 0;
				for(int j = 0; j < n; j++){
					columnMax = Math.max(columnMax, students[j][i]);
				}
				for(int j = 0; j < n; j++){
					rowMin = Math.min(rowMin, students[i][j]);
				}
				for(int j = 0; j < n; j++){
					if(columnMax == students[j][i]){
						tallest[j][i] = true;
						break;
					}
				}
				for(int j = 0; j < n; j++){
					if(rowMin == students[i][j]){
						shortest[i][j] = true;
						break;
					}
				}
			}
			boolean noAns = true;
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					if(shortest[i][j] && tallest[i][j]){
						System.out.println(students[i][j]);
						noAns = false;
						break;
					}
				}
			}
//			if(noAns){
//				System.out.println(0);
//			}
		}
		
	}
}

Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		for(int n = sc.nextInt(); n > 0; n = sc.nextInt()) {
            int res = 0;
            for(int i = 0; i < n; i++) {
                int min = Integer.MAX_VALUE;
                for(int j = 0; j < n; j++)
                    min = min(min, sc.nextInt());
                res = max(res, min);
            }
            System.out.println(res);
        }
		
	}
}

Compiler output:
Main.java:12: error: cannot find symbol
                    min = min(min, sc.nextInt());
                          ^
  symbol:   method min(int,int)
  location: class Main
Main.java:13: error: cannot find symbol
                res = max(res, min);
                      ^
  symbol:   method max(int,int)
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			if(n == 0){
				break;
			}
			int[][] students = new int[n][n];
			boolean[][] tallest = new boolean[n][n];
			boolean[][] shortest = new boolean[n][n];
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					students[i][j] = sc.nextInt();
				}
			}
			for(int i = 0; i < n; i++){
				int rowMin = Integer.MAX_VALUE, columnMax = 0;
				for(int j = 0; j < n; j++){
					columnMax = Math.max(columnMax, students[j][i]);
				}
				for(int j = 0; j < n; j++){
					rowMin = Math.min(rowMin, students[i][j]);
				}
				for(int j = 0; j < n; j++){
					if(columnMax == students[j][i]){
						tallest[j][i] = true;
						break;
					}
				}
				for(int j = 0; j < n; j++){
					if(rowMin == students[i][j]){
						shortest[i][j] = true;
						break;
					}
				}
			}
			boolean noAns = true;
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					if(shortest[i][j] && tallest[i][j]){
						sb.append(students[i][j] + " ");
						noAns = false;
					}
				}
			}
			
			if(noAns){
				System.out.println(0);
			}else{
				sb.deleteCharAt(sb.length() - 1);
				System.out.print(sb);
			}
		}
		
	}
}

Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n == 0){
				break;
			}
			int[][] students = new int[n][n];
			boolean[][] tallest = new boolean[n][n];
			boolean[][] shortest = new boolean[n][n];
			int[][] x = new int[n][n];
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					students[i][j] = sc.nextInt();
				}
			}
			
			for(int i = 0; i < n; i++){
				int columnMax = -1, maxj = -1;
				for(int j = 0; j < n; j++){
					if(columnMax < students[j][i]){
						columnMax = students[j][i];
                        maxj = j;
                    }
				}
				if(columnMax == students[maxj][i]){
					tallest[maxj][i] = true;
					x[maxj][i] |= 2;
				}
/*				for(int j = 0; j < n; j++){
					if(columnMax == students[j][i]){
						tallest[j][i] = true;
						x[j][i] |= 2;
					}
				}
*/			}
			for(int i = 0; i < n; i++){
				int rowMin = Integer.MAX_VALUE, minj = -1;
				for(int j = 0; j < n; j++){
					if(rowMin > students[i][j]){
						rowMin = students[i][j];
                        minj = j;
                    }
				}
				if(rowMin == students[i][minj]){
					shortest[i][minj] = true;
					x[i][minj] |= 1;
				}
/*				for(int j = 0; j < n; j++){
					if(rowMin == students[i][minj]){
						shortest[i][minj] = true;
						x[i][minj] |= 1;
					}
				}
*/			}
			
			Set<Integer> both = new HashSet<Integer>();
            for(int i = 0;i < n;i++){
                for(int j = 0;j < n;j++){
                    if(x[i][j] == 3){
                        both.add(students[i][j]);
                    }
                }
            }
			
            if(both.size() == 1){
            	StringBuilder sb = new StringBuilder();
                for(int v : both){
                    sb.append(v + " ");
                }
                sb.deleteCharAt(sb.length() - 1);
                System.out.println(sb);
            }else{
            	System.out.println(0);
            }
/*			boolean noAns = true;
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					if(shortest[i][j] && tallest[i][j]){
						sb.append(students[i][j] + " ");
						noAns = false;
					}
				}
			}
			
			if(noAns){
				System.out.println(0);
			}else{
				sb.deleteCharAt(sb.length() - 1);
				System.out.print(sb);
			}
*/		}
		
	}
}

Compiler output:
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n == 0){
				break;
			}
			int[][] students = new int[n][n];
			int[][] x = new int[n][n];
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					students[i][j] = sc.nextInt();
				}
			}
			
			for(int i = 0; i < n; i++){
				int columnMax = -1;
				for(int j = 0; j < n; j++){
					if(columnMax < students[j][i])
						columnMax = students[j][i];
				}
				for(int j = 0; j < n; j++){
					if(columnMax == students[j][i])
						x[j][i] |= 2;
				}
			}
			for(int i = 0; i < n; i++){
				int rowMin = Integer.MAX_VALUE;
				for(int j = 0; j < n; j++){
					if(rowMin > students[i][j])
						rowMin = students[i][j];
				}
				for(int j = 0; j < n; j++){
					if(rowMin == students[i][j])
						x[i][j] |= 1;
				}
			}
			
			Set<Integer> both = new HashSet<Integer>();
            for(int i = 0;i < n;i++)
                for(int j = 0;j < n;j++)
                    if(x[i][j] == 3)
                        both.add(students[i][j]);
			
            if(both.size() == 1){
            	StringBuilder sb = new StringBuilder();
                for(int v : both){
                    sb.append(v + " ");
                }
                sb.deleteCharAt(sb.length() - 1);
                System.out.println(sb);
            }else{
            	System.out.println(0);
            }
		}
	}
}

Compiler output:
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: C

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;


int a[100][100];
bool shortest[100][100],tallest[100][100];

int main(){
	int n;
	while(cin>>n&&n){
		int ans=0;
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)cin>>a[i][j];
		memset(shortest,false,sizeof(shortest));
		memset(tallest,false,sizeof(tallest));
		for(int i=0;i<n;i++){
			int minv=1<<30;
			for(int j=0;j<n;j++)minv=min(minv,a[i][j]);
			for(int j=0;j<n;j++)if(a[i][j]==minv)shortest[i][j]=true;
		}
		for(int j=0;j<n;j++){
			int maxv=-1;
			for(int i=0;i<n;i++)maxv=max(maxv,a[i][j]);
			for(int i=0;i<n;i++)if(a[i][j]==maxv)tallest[i][j]=true;
		}
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				if(shortest[i][j]&&tallest[i][j])ans=a[i][j];
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++h>
using namespace std;

int main(){

    while(1){
        int n; cin >> n;
        if(!n) break;
        vector<vector<int> > a(n, vector<int> (n));
        vector<vector<pair<int, int> > > hand(n, vector<pair<int, int> > (n, {0, 0}));
        for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> a[i][j];

        for(int i = 0; i < n; i++){
            int tmp_m = 100100100;
            int tmp_j;
            for(int j = 0; j < n; j++){
                if(tmp_m > a[i][j]){
                    tmp_m = a[i][j];
                    tmp_j = j;
                }
            }

            hand[i][tmp_j].first = true;

        }

        for(int j = 0; j < n; j++){
            int tmp_M = 0;
            int tmp_i;
            for(int i = 0; i < n; i++){
                if(tmp_M < a[i][j]){
                    tmp_M = a[i][j];
                    tmp_i = i;
                }
            }

            hand[tmp_i][j].second = true;
        }

        int ans = 0;
        
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(hand[i][j].first && hand[i][j].second) ans = max(ans, a[i][j);
            }
        }

        cout << ans << endl;

    }

    return 0;
}


Compiler output:
a.cc:1:9: fatal error: bits/stdc++h: No such file or directory
    1 | #include<bits/stdc++h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;
const int mod = 1e9 + 7;
const double EPS = 1e-9;


int main(){
	int n;
	while(cin>>n){
		vvi v(n, vi(n, 0)), u(n, vi(n, 0));
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				cin>>v[i][j];
			}
		}

		int a = 0, b = 0;
		for(int i = 0; i < n; i++){
			a = b = i;
			for(int j = 0; j < n; j++){
				if(v[i][a] > v[i][j]) a = j;
				if(v[b][i] < v[j][i]) b = j;
			}
			u[i][a] = 1;
			u[b][i] = 1;
		}

		int ans = 0;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				if(u[i][j]) ans++;
			}
		}

		cout<<ans<<endl;
	}
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:43:17: error: 'vvi' was not declared in this scope; did you mean 'vii'?
   43 |                 vvi v(n, vi(n, 0)), u(n, vi(n, 0));
      |                 ^~~
      |                 vii
a.cc:46:38: error: 'v' was not declared in this scope
   46 |                                 cin>>v[i][j];
      |                                      ^
a.cc:54:36: error: 'v' was not declared in this scope
   54 |                                 if(v[i][a] > v[i][j]) a = j;
      |                                    ^
a.cc:55:36: error: 'v' was not declared in this scope
   55 |                                 if(v[b][i] < v[j][i]) b = j;
      |                                    ^
a.cc:57:25: error: 'u' was not declared in this scope
   57 |                         u[i][a] = 1;
      |                         ^
a.cc:64:36: error: 'u' was not declared in this scope
   64 |                                 if(u[i][j]) ans++;
      |                                    ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int a,a[120][120],b[120][120];
int p[12000];
int main(){
	while(true){
		cin>>n;
		if(n==0){break;}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				cin>>a[i][j];
				b[j][i]=a[i][j];
			}
		}
		for(int i=0;i<n;i++){
			sort(a[i],a[i]+n);
			sort(b[i],b[i]+n);
		}
		int P=0;
		for(int i=0;i<n;i++){
			p[a[i][0]]++;
			p[b[i][n-1]]++;
			if(p[a[i][0]]==2)P=a[i][0];
			if(p[b[i][n-1]]==2)P=b[i][n-1];
		}
		cout<<P<<endl;
	}
}

Compiler output:
a.cc:4:7: error: conflicting declaration 'int a [120][120]'
    4 | int a,a[120][120],b[120][120];
      |       ^
a.cc:4:5: note: previous declaration as 'int a'
    4 | int a,a[120][120],b[120][120];
      |     ^
a.cc: In function 'int main()':
a.cc:8:22: error: 'n' was not declared in this scope
    8 |                 cin>>n;
      |                      ^
a.cc:12:39: error: invalid types 'int[int]' for array subscript
   12 |                                 cin>>a[i][j];
      |                                       ^
a.cc:13:42: error: invalid types 'int[int]' for array subscript
   13 |                                 b[j][i]=a[i][j];
      |                                          ^
a.cc:17:31: error: invalid types 'int[int]' for array subscript
   17 |                         sort(a[i],a[i]+n);
      |                               ^
a.cc:17:36: error: invalid types 'int[int]' for array subscript
   17 |                         sort(a[i],a[i]+n);
      |                                    ^
a.cc:22:28: error: invalid types 'int[int]' for array subscript
   22 |                         p[a[i][0]]++;
      |                            ^
a.cc:24:31: error: invalid types 'int[int]' for array subscript
   24 |                         if(p[a[i][0]]==2)P=a[i][0];
      |                               ^
a.cc:24:45: error: invalid types 'int[int]' for array subscript
   24 |                         if(p[a[i][0]]==2)P=a[i][0];
      |                                             ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int m[101][101];
typedef pair<int, int> P;

int main() {

	
	while (cin >> n,n) {
		vector<P> row;
		vector<P> ans;
		for (int x = 0; x < n; x++) {
			for (int y = 0; y < n; y++) {
				cin >> m[x][y];
			}
		}
		for (int x = 0; x < n; x++) {
			int u = m[x][0];
			for (int i = 0; i < n; i++) {
				u = min(u, m[x][i]);
			}
			for (int i = 0; i < n; i++) {
				if (u == m[x][i]) {
					P p(x, i);
					row.push_back(p);
				}
			}
		}
		for (int y = 0; y < n; y++) {
			int u = m[0][y], t = 0;
			for (int i = 0; i < n; i++) {
				u = max(u, m[i][y]);
			}
			for (int i = 0; i < n; i++) {
				if (u == m[i][y]) {
					P p(i, y);
						for(int j = 0; j < row.size(); j++) {
							if (row[j] == p)ans.push_back(p);
						}
				}
			}
		}
		int t = 0;
		for (int i = 0; i < ans.size(); i++) {
			if(!i) {
				int x = ans[i].first;
			int y = ans[i].second;
			t =  m[x][y];
		}
		else
		{
			int x = ans[i].first;
			int y = ans[i].second;
			t = max(t, m[x][y]);
		}
		}
		cout << t << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'n' was not declared in this scope
   12 |         while (cin >> n,n) {
      |                       ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<unordered_map>
#include<map>
using namespace std;

int a[100][100];
int k[100][100];
signed main() {
	int b;
	while (cin >> b, b) {
		memset(k, 0, sizeof(k));
		for (int c = 0; c < b; c++) {
			for (int d = 0; d < b; d++) {
				cin >> a[c][d];
			}
		}
		for (int c = 0; c < b; c++) {
			int MAX = 0;
			for (int d = 0; d < b; d++) {
				MAX = max(MAX, a[d][c]);
			}
			for (int d = 0; d < b; d++) {
				if (a[d][c] == MAX)k[d][c]++;
			}
		}
		for (int c = 0; c < b; c++) {
			int MIN = 1 << 29;
			for (int d = 0; d < b; d++) {
				MIN = min(MIN, a[c][d]);
			}
			for (int d = 0; d < b; d++) {
				if (a[c][d] == MIN)k[c][d]++;
			}
		}
		int MAX = -1;
		for (int i = 0; i < b; i++) {
			for (int j = 0; j < b; j++) {
				if (k[i][j] == 2) {
					MAX = max(MAX, a[i][j]);
				}
			}
		}
		cout << MAX << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
   20 |                 memset(k, 0, sizeof(k));
      |                 ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include<map>
  +++ |+#include <cstring>
   13 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define rep(i) for(int i=0;i<n;i++)using namespace std;int n,c,a[110],b[110];int main(){while(cin>>n&&n){rep(i)a[i]=1145141919,b[i]=0;rep(i)rep(j){cin>>c;a[i]=min(a[i],c);b[j]=max(b[j],c);}rep(i)rep(j)if(a[i]==b[j]){cout<<a[i]<<endl;goto loop;}cout<<"0"<<endl;loop:;}return 0;}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>
#include<limits.h>


int main(){
  int m[100][100],n,i,j,k,l;
  int rc,cr;
  char buf[1000],*ind,*prev;
  do{
    fgets(buf,1000,stdin);
    n=atoi(buf);
    if(!n) break;
    for(i=0;i<n;i++){
      fgets(buf,1000,stdin);
      prev=ind=buf;
      j=0;
      while((ind=strchr(ind,' '))!=NULL){
	*ind='\0';
	ind++;
	m[i][j++]=atoi(prev);
	prev=ind;
      }
      m[i][j]=atoi(prev);
    }
    for(i=0,rc=0,cr=INT_MAX;i<n;i++){
      for(j=0,k=INT_MAX,l=0;j<n;j++){
	if(k>m[i][j]) k=m[i][j];
	if(l<m[j][i]) l=m[j][i];
      }
      if(rc<k) rc=k;
      if(cr>l) cr=l;
    }
    if(rc==cr)
      printf("%d\n",rc);
    else
      printf("0\n");
  }while(1);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'atoi' was not declared in this scope
   11 |     n=atoi(buf);
      |       ^~~~
a.cc:17:18: error: 'strchr' was not declared in this scope
   17 |       while((ind=strchr(ind,' '))!=NULL){
      |                  ^~~~~~
a.cc:3:1: note: 'strchr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<limits.h>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <iostream>
using namespace std;

int d[100][100];
int main(){
	int n;
	while(cin >> n && n){
		for(int i = 0 ; i < n ; i++)
			for(int j = 0 ; j < n ; j++)
				cin >> d[i][j];
		int cnt[100][100] = {0};
		for(int i = 0 ; i < n ; i++) cnt[i][min_element(cnt[i],cnt[i]+n)-cnt[i]]++;
		for(int i = 0 ; i < n ; i++){
			int k = 0;
			for(int j = 0 ; j < n ; j++){
				if( d[j][i] > d[k][i]) k = j;
			}
			cnt[k][i]++;
		}
		for(int i = 0 ; i < n ; i++)
			for(int j = 0 ; j < n ; j++)
				if(cnt[i][j] == 2){ cout << d[i][j] << endl;goto exit;}
		cout << 0 << endl;
		exit:;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:53: error: 'min_element' was not declared in this scope
   12 |                 for(int i = 0 ; i < n ; i++) cnt[i][min_element(cnt[i],cnt[i]+n)-cnt[i]]++;
      |                                                     ^~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n;
	long long a[100][100];
	bool r[100][100],c[100][100];
	
	while(cin >> n && n){
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++){
				cin >> a[i][j];
				r[i][j] = c[i][j] = false;
			}
		
		for(int i=0;i<n;i++){
			long long m = -1;
			for(int j=0;j<n;j++)
				if(m<0 || m<a[i][j])m = a[i][j];
			for(int j=0;j<n;j++)
				if(a[i][j] == m)r[i][j] = true;
				
			m = -1;
			for(int j=0;j<n;j++)
				if(m<0 || m>a[j][i])m = a[j][i];
			for(int j=0;j<n;j++)
				if(a[j][i] == m)c[j][i] = true;
		}
		bool f = false;
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				if(r[i][j] && c[i][j]){
					cout << a[i][j] << endl;
				  f = true;
				}
		if(!f)cout << 0 << endl;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:10: error: expected '}' at end of input
   37 |         }
      |          ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int n;
	while(cin>>n)
	{
		int p[10001],q,flag,flag1,flag2;
		for(int k=0;k<n;k++)
		{
		for(int i=0;i<n;i++)
		{
			cin>>p[i+n*k];
			if(i==0){q=p[i+n*k];flag1=0;}
            if(q>p[i+n*k]){q=p[i+n*k],flag1=i;}
		}
		if(k==0)flag=q;
		else if(flag<q)
		{
         flag=q;
		 flag2=flag1;
		}
		}
		for(int l=0;l<n;l++)
			if(flag<p[flag2+l*n])break;
		if(l==n)
			cout<<flag<<endl;
		else 
			cout<<"0"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: 'l' was not declared in this scope
   26 |                 if(l==n)
      |                    ^
Language: C++



#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a[101][101];
	int row[101],col[101];
	int n,i,j,temp[101],k,num[101],s[10001];
	while(cin>>n)
	{
		memset(num,0,sizeof(num));
		if(n==0)return 0;
		for(i=0;i<n;i++)
			for(j=0;j<n;j++)
			   cin>>a[i][j];
		
			for(i=0;i<n;i++)
			{
		      for(j=0;j<n;j++)
			  { 
				  temp[j]=a[i][j];
				   num[j]=a[j][i];
			  }
			  sort(temp,temp+n);
			  sort(num,num+n);
			  row[i]=temp[0];
			  col[i]=num[n-1];
			}
			k=0;
			memset(s,0,sizeof(s));
			for(i=0;i<n;i++)
			for(j=0;j<n;j++)
			{
				if(a[i][j]==row[i]&&a[i][j]==col[j])
				{
					s[k]=a[i][j];
				     k++;
				}
			}
			sort(s,s+k);
			cout<<s[0];
			for(i=1;i<k;i++)
			{
				if(s[i]!=s[i-1]&&s[i]!=0)
					cout<<" "<<s[i];
			}
			cout<<endl;


	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(num,0,sizeof(num));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int n,zs;
	while((cin>>n)&&n!=0)
	{ 
		int temp3=0;
		int (*a)[100],(*b)[100];
		a=new int[100][100],b=new int[100][100];
		int *temp0=new int[n],*temp=new int[n];
		memset(b,0,sizeof(b));
		memset(temp,0,sizeof(temp));
		for(int c=0;c<n;c++)
		{
			for(int d=0;d<n;d++)
			{
				cin>>a[c][d];
			}
		}
		for(int i=0;i<n;i++)
		{
			zs=a[i][0];
			temp[i]=0;
			for(int j=1;j<n;j++)
			{if(zs>a[i][j]) 
			{
				zs=a[i][j];
				temp[i]=j;//隶ー蠖穂ス咲スョ蜿キ
			}
			}
			b[i][temp[i]]=1;
		}
		for(int k=0;k<n;k++)
		{
			zs=a[0][k];
			temp0[k]=0;
			for(int l=1;l<n;l++)
			{
				if(a[l][k]>zs)
				{
					zs=a[l][k];
					temp0[k]=l;
				}
			}
			if(b[temp0[k]][k]==1)
			{ cout<<a[temp0[k]][k]<<endl;
			temp3++;
			break;
			}
		}
		if(temp3==0)
			cout<<0<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'memset' was not declared in this scope
   12 |                 memset(b,0,sizeof(b));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <cstring>
#include <iostream>
using namespace std;
int main()
{
	int n,zs;
	while((cin>>n)&&n!=0)
	{ 
		int temp3=0,a[100][100],b[100][100];
		//int (*a)[100],(*b)[100];
		//a=new int[100][100],b=new int[100][100];
		int *temp0=new int[n],*temp=new int[n];
		memset(b,0,sizeof(b));
		memset(temp,0,sizeof(temp));
		for(int c=0;c<n;c++)
		{
			for(int d=0;d<n;d++)
			{
				cin>>a[c][d];
			}
		}
		for(int i=0;i<n;i++)
		{
			zs=a[i][0];
			temp[i]=0;
			for(int j=1;j<n;j++)
			{if(zs>a[i][j]) 
			{
				zs=a[i][j];
				temp[i]=j;//隶ー蠖穂ス咲スョ蜿キ
			}
			}
			for(j=1;j<n;j++)
			{
				if(zs==a[i][j])
     			b[i][temp[i]]++;
			}
		}
		for(int k=0;k<n;k++)
		{
			zs=a[0][k];
			temp0[k]=0;
			for(int l=1;l<n;l++)
			{
				if(a[l][k]>zs)
				{
					zs=a[l][k];
					temp0[k]=l;
				}
			}
			for(l=0;l<n;l++)
			{
				if(zs==a[l][k])
		        b[temp0[k]][k]++;
			}
		}
		for(int p=0;p<n;p++)
		{
			if(temp3==1)break;
			for(int q=0;q<n;q++)
             if(b[p][q]==2)
			 {
				 cout<<a[p][q]<<endl;temp3=1;break;}
		}
		if(temp3==0)
			cout<<"0"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:29: error: 'j' was not declared in this scope
   33 |                         for(j=1;j<n;j++)
      |                             ^
a.cc:51:29: error: 'l' was not declared in this scope
   51 |                         for(l=0;l<n;l++)
      |                             ^