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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        List<List<Long>> list = new ArrayList<>();
        long ans = 0;
        for (int i = 0; i < N; i++) {
            String[] arr =  br.readLine().split(" ");
            list.add(Arrays.asList(
                Long.parseLong(arr[0]),
                Long.parseLong(arr[1]),
                Long.parseLong(arr[0]) + Long.parseLong(arr[1])
            ));
        }
        list.sort((a, b) -> {
                if (a.get(2) - b.get(2) != 0) {
                    return b.get(2) - a.get(2) > 0 ? 1 : -1;
                } else {
                    return b.get(0) - a.get(0) > 0 ? 1 : -1;
                }
            }
        );
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                ans += list.get(i).get(0); 
            } else {
                ans -= list.get(i).get(1);
            }
        }
        out.println(ans);
        out.close();
    }
}

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

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

int N;

typedef long long ll;

ll T = 0,AO = 0;

struct Data {
  ll  A[1000000];
  ll  B[1000000];
  ll  C[1000000];
};

int main() {
  cin >> N;
  Data data;
  fot ( int i = 0; i < 1000000; i++ ) C[i] = 0;
  for ( int i = 0; i < N; i++ ) {
    cin >> data.A[i] >> data.B[i];
    data.C[i] = data.A[i] + data.B[i];
  }

  sort(data.C,data.C+N);
  sort(data.A,data.A+N);
 
 
  bool f = true;

  for ( int i = N-1; i >= 0; i-- ) {
    while( C[i] == C[i+1] ) {
       if (f)  {
	 T += max(data.A[i],data.B[i]);
      f = false;
    }
    else {
      AO += max(data.B[i],data.A[i]);
      f = true;
    }
    }
    if (f)  {
      T += data.A[i];
      f = false;
    }
    else {
      AO += data.B[i];
      f = true;
    }
  }

  cout << T - AO << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected primary-expression before 'int'
   20 |   fot ( int i = 0; i < 1000000; i++ ) C[i] = 0;
      |         ^~~
a.cc:20:20: error: 'i' was not declared in this scope
   20 |   fot ( int i = 0; i < 1000000; i++ ) C[i] = 0;
      |                    ^
a.cc:33:12: error: 'C' was not declared in this scope
   33 |     while( C[i] == C[i+1] ) {
      |            ^
Language: C

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

int main(){

	int X;
	int N;
	int n = 0;
	char A[100];
	char B[100];
	char C[100];

	scanf("%d",&N);
	scanf("%s",A);
	scanf("%s",B);
	scanf("%s",C);

/* 文字列選択 */
	i = 0;
	for (i = 0;i < N; i++){
		if (A[i] == B[i]){
			if (B[i] == C[i]) {
			} else {
				n++;
			}
		} else {
			n ++;
			if (A[i] == C[i]) {
				if (B[i] == C[i]) {
				} else {
					n++;
				}
			} else {
				n++;
			}
		}
	}
	printf("%d",n);
	return 0;
}

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

#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
class Node{
 public:
  vector<ll> children;
  ll parent;
  ll depth;
};
void defdepth(vector<Node*>& node,ll i,ll de,ll pa){
    if(de>node[i]->depth){
      node[i]->depth=de;
      node[i]->parent=pa;
    }else{return;}
  if(node[i]->children.size()==0){
    return;
  }
  for(int ii=0;ii<node[i]->children.size();++ii){
    defdepth(node,node[i]->children[ii],node[i]->depth+1,i);
  }
  return;
}
ll sarchroot(vector<Node*>& node){
  vector<int> n(node.size(),0);
  for(int i=1;i<node.size();++i){
  	for(int ii=0;ii<node[i]->children.size();++ii){
      n[node[i]->children[ii]]=1;
  	}
  }
  for(int i=1;i<node.size();++i){if(n[i]==0)return i;}
}
int main(){
  ll N,M;
  cin>>N>>M;
  vector<Node*> node;
  node.push_back(new Node());
  for(ll i=0;i<N;++i){node.push_back(new Node());}
  for(ll i=0;i<N+1;++i){node[i]->depth=0;}
  for(ll i=0;i<N+M-1;++i){
    ll a,b;
    cin>>a>>b;
    node[a]->children.push_back(b);
    //node[b]->parent.push_back(a);
  }
  for(ll i=1;i<=N;++i){
    ll root = sarchroot(node);
    defdepth(node,root,0,0);
  }
  for(ll i=1;i<=N;++i){
      cout<<node[i]->parent<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc:55:3: error: expected unqualified-id before 'return'
   55 |   return 0;
      |   ^~~~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
a.cc: In function 'll sarchroot(std::vector<Node*>&)':
a.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int main(void)
{
	int N,A,B;
	int max, min;
	cin >> N >> A>>B;
	if (N == A && N == B)
	{
		max = A;
		min = B;
		cout << max << " "<<min;
	}
	if ((A+B)==N)
	{
		min = 0;
		if (A > B)
		{

			max = B;
		}
		else(A<B)
		{
			max = A;
		}
		cout << max <<" "<< min;
	}
	if (N > (A + B))
	{
		min = 0;
		if (A > B)
		{
			max = B;
		}
		else(A<B)
		{
			max = A;
		}
		cout  << max << " "<<min;
	}
	if (N < (A + B)&& A!=B)
	{
		if (A > B)
		{
			min = A - B;
			max = B;
		}
		else (A<B)
		{
			min = B - A;
			max = A;
		}
		cout << max <<" "<< min;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: expected ';' before '{' token
   25 |                 else(A<B)
      |                          ^
      |                          ;
   26 |                 {
      |                 ~         
a.cc:38:26: error: expected ';' before '{' token
   38 |                 else(A<B)
      |                          ^
      |                          ;
   39 |                 {
      |                 ~         
a.cc:51:27: error: expected ';' before '{' token
   51 |                 else (A<B)
      |                           ^
      |                           ;
   52 |                 {
      |                 ~
Language: Java

import java.util.Random;
public Class Main {
  public static void main(int n,int a,int b){
  	int max = 0;
    int min = 0;
    if(a < b){
      max = a;
    }else {
      max = b;
    }
    Random random = new Random();
	min = random.nextInt(max);
    System.out.print(max + " " + min);
  }
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
public Class Main {
       ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(int n,int a,int b){
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:15: error: class, interface, enum, or record expected
}
^
3 errors
Language: C

#include <stdio.h>
    #include <stdlib.h>
 
    int main(void){
     int a,b,n,p,q;
     
     scanf_s("%d %d %d",&n,&a,&b);
     
     if(a<b) {
                 if(a+b < n){
                 q=0;
                 }
                 else{       
                 q=b+a-n;
                }            
                 p=a;             
         } 
     else if(b<a){
                 if(a+b < n){
                 q = 0;
                 }
                 else{
                 q=a+b-n;
              }
                 p=b;
         }
     else if(a==b){
                if(b==n){
                        q=a;
                        p=b;
                  }
      }
     
     printf("%d %d\n",p,abs(q));
     
     return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:7:6: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |      scanf_s("%d %d %d",&n,&a,&b);
      |      ^~~~~~~
      |      scanf
Language: C

#include <stdio.h>
int main(void)
{
	int N,A,B;
	int max, min;
	scanf("%d",&N);
        scanf("%d"&A);
        scanf("%d"&B);
	if (N == A && N == B)
	{
		max = A;
		min = B;
		printf("%d %d",max,min);
	}
	if ((A+B)==N)
	{
		min = 0;
		if (A > B)
		{

			max = B;
		}
		else
		{
			max = A;
		}
		printf("%d %d",max,min);
	}
	if (N > (A + B))
	{
		min = 0;
		if (A > B)
		{
			max = B;
		}
		else
		{
			max = A;
		}
		printf("%d %d",max,min);
	}
	if (N < (A + B)&& A!=B)
	{
		if (A > B)
		{
			min = A - B;
			max = B;
		}
		else
		{
			min = B - A;
			max = A;
		}
		printf("%d %d",max,min);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:19: error: invalid operands to binary & (have 'char *' and 'int')
    7 |         scanf("%d"&A);
      |               ~~~~^
      |               |
      |               char *
main.c:8:19: error: invalid operands to binary & (have 'char *' and 'int')
    8 |         scanf("%d"&B);
      |               ~~~~^
      |               |
      |               char *
Language: Java

import java.time.chrono.MinguoChronology;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int ansMin = 0;
		int ansMax = 0;
		if(a == b && b==c) {
			ansMin = a;
			ansMax = a;
		} else if ( a/2 <= b && a/2 <= c && a <= b+c) {
			if(b > c) {
				ansMin = b-a/2;
				ansMax=c;
			} else {
				ansMin = c-a/2;
				ansMax=b;
			}
		}else if (( a/2 <= b || a/2) <= c && a <= b+c) {
			ansMin = b+c-a;
			if(b > c) {
				ansMax=c;
			} else {
				ansMax=b;
			}
		}else if ( 0 == b || c==0) {
		ansMin = 0;
		ansMax=0;
	}
		else {
			ansMin = 0;
			if(b > c) {
				ansMax=c;
			} else {
				ansMax=b;
			}
		}
		System.out.println(ansMax+" "+ansMin);
		
	}

}


Compiler output:
Main.java:27: error: bad operand types for binary operator '||'
		}else if (( a/2 <= b || a/2) <= c && a <= b+c) {
		                     ^
  first type:  boolean
  second type: int
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main2 {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int n = sc.nextInt();
		String[] s1 = sc.nextLine().split("");
		String[] s2 = sc.nextLine().split("");
		String[] s3 = sc.nextLine().split("");
		int ans = 0;
		for (int i = 0; i < n; i++) {
			if(s2[i].charAt(0) != s3[i].charAt(0))
				ans++;
			if(s1[i].charAt(0) != s2[i].charAt(0) && s1[i].charAt(0) != s3[i].charAt(0))
				ans++;
		}
		System.out.println(ans);
	}


}

class Scanner {
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream system) {
		br = new BufferedReader(new InputStreamReader(system));
	}

	public String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public String nextLine() throws IOException {
		return br.readLine();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public char nextChar() throws IOException {
		return next().charAt(0);
	}

	public Long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	public boolean ready() throws IOException {
		return br.ready();
	}

	public void waitForInput() throws InterruptedException {
		Thread.sleep(3000);
	}

}


Compiler output:
Main.java:8: 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 scan = new Scanner(System.in);
         int x = scan.nextInt();
         int y = scan.nextInt();
         int z = scan.nextInt();
         scan.close();
         if (y>z) {
             System.out.print(z);
         } else if (y<z) {
             System.out.print(y);
         } else {
             System.out.print(y);
         }
         System.out.print(" ");
 
         if (x==y && y==z) {
             System.out.print(x);
         } else { 
             if (x > (y+z)) {
                 System.out.print("0");
             }else if (x < (y+z)){
                 if (y<z){
                 int n = z-y;
                 System.out.print(n);
             }else{
                 int n = y-z;
                 System.out.print(n);
             }
        }
    } 
}

Compiler output:
Main.java:33: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
     int t,x,y;
    cin>>t >> x >> y;
    cout << min(x,y) <<" ";
    if (t<x+y) cout << x+y-t;
esle cout<< 0; 
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: 'esle' was not declared in this scope
   14 | esle cout<< 0;
      | ^~~~
Language: C

#include <stdio.h>
int main(void){
  
  int N>=1&&N<=100;
  int A>=0&&A<=N;
  int B>=0&&B<=N;
  int max,min;
  scanf("%d %d %d",&N,&A,&B);
  if(A<B&&N>=A+B){
    max=A;
    min=0;
  }
   if(A<B&&N<=A+B){
    max=A;
    min=A+B-N;
  }
   if(A>B&&N>=A+B){
    max=B;
    min=0;
  }
   if(A>B&&N<=A+B){
    max=B;
    min=A+B-N;
  }
  printf("%d %d",max,min);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    4 |   int N>=1&&N<=100;
      |        ^~
main.c:4:8: error: expected expression before '>=' token
main.c:5:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    5 |   int A>=0&&A<=N;
      |        ^~
main.c:5:8: error: expected expression before '>=' token
main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    6 |   int B>=0&&B<=N;
      |        ^~
main.c:6:8: error: expected expression before '>=' token
main.c:8:21: error: 'N' undeclared (first use in this function)
    8 |   scanf("%d %d %d",&N,&A,&B);
      |                     ^
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:24: error: 'A' undeclared (first use in this function)
    8 |   scanf("%d %d %d",&N,&A,&B);
      |                        ^
main.c:8:27: error: 'B' undeclared (first use in this function)
    8 |   scanf("%d %d %d",&N,&A,&B);
      |                           ^
Language: C++

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

int main() {
  int N, A, B;
  cin >> N;
  cin >> A;
  cin >> B;
  if(A>B){
    if(N-A>B) {
	cout << A - B << endl;
}
}  else {
    if(N-B>A) {
	cout << B - A << endl;
}  
}
  if(N-s)

}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 's' was not declared in this scope
   18 |   if(N-s)
      |        ^
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
  
  int N>=1,N<=100;
  int A>=0,A<=N;
  int B>=0,B<=N;
  int max,min;
  scanf("%d %d %d",&N,&A,&B);
  if(A<B&&N>=A+B){
    max=A;
    min=0;
  }
   if(A<B&&N<=A+B){
    max=A;
    min=A+B-N;
  }
   if(A>B&&N>=A+B){
    max=B;
    min=0;
  }
   if(A>B&&N<=A+B){
    max=B;
    min=A+B-N;
  }
  printf("%d %d",max,min);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    4 |   int N>=1,N<=100;
      |        ^~
main.c:4:8: error: expected expression before '>=' token
main.c:5:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    5 |   int A>=0,A<=N;
      |        ^~
main.c:5:8: error: expected expression before '>=' token
main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    6 |   int B>=0,B<=N;
      |        ^~
main.c:6:8: error: expected expression before '>=' token
main.c:8:21: error: 'N' undeclared (first use in this function)
    8 |   scanf("%d %d %d",&N,&A,&B);
      |                     ^
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:24: error: 'A' undeclared (first use in this function)
    8 |   scanf("%d %d %d",&N,&A,&B);
      |                        ^
main.c:8:27: error: 'B' undeclared (first use in this function)
    8 |   scanf("%d %d %d",&N,&A,&B);
      |                           ^
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        System.out.println(Math.min(A, B) + " " + Math.max(-(N - A - B), 0));
    }


Compiler output:
Main.java:10: error: reached end of file while parsing
    }
     ^
1 error
Language: C

#include <stdio.h>
int main(void){
  
  int N;
  int A;
  int B;
  
  scanf("%d %d %d",&N,&A,&B);
  if(A<B&&N>=A+B){
    max=A;
    min=0;
  }
   if(A<B&&N<=A+B){
    max=A;
    min=A+B-N;
  }
   if(A>B&&N>=A+B){
    max=B;
    min=0;
  }
   if(A>B&&N<=A+B){
    max=B;
    min=A+B-N;
  }
  printf("%d %d",max,min);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:5: error: 'max' undeclared (first use in this function)
   10 |     max=A;
      |     ^~~
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:5: error: 'min' undeclared (first use in this function); did you mean 'main'?
   11 |     min=0;
      |     ^~~
      |     main
Language: C++

#include <stdio.h>
int main(void){
  
  int N;
  int A;
  int B;
  
  scanf("%d %d %d",&N,&A,&B);
  if(A<B&&N>=A+B){
    max=A;
    min=0;
  }
   if(A<B&&N<=A+B){
    max=A;
    min=A+B-N;
  }
   if(A>B&&N>=A+B){
    max=B;
    min=0;
  }
   if(A>B&&N<=A+B){
    max=B;
    min=A+B-N;
  }
  printf("%d %d",max,min);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'max' was not declared in this scope
   10 |     max=A;
      |     ^~~
a.cc:11:5: error: 'min' was not declared in this scope; did you mean 'main'?
   11 |     min=0;
      |     ^~~
      |     main
a.cc:14:5: error: 'max' was not declared in this scope
   14 |     max=A;
      |     ^~~
a.cc:15:5: error: 'min' was not declared in this scope; did you mean 'main'?
   15 |     min=A+B-N;
      |     ^~~
      |     main
a.cc:18:5: error: 'max' was not declared in this scope
   18 |     max=B;
      |     ^~~
a.cc:19:5: error: 'min' was not declared in this scope; did you mean 'main'?
   19 |     min=0;
      |     ^~~
      |     main
a.cc:22:5: error: 'max' was not declared in this scope
   22 |     max=B;
      |     ^~~
a.cc:23:5: error: 'min' was not declared in this scope; did you mean 'main'?
   23 |     min=A+B-N;
      |     ^~~
      |     main
a.cc:25:18: error: 'max' was not declared in this scope
   25 |   printf("%d %d",max,min);
      |                  ^~~
a.cc:25:22: error: 'min' was not declared in this scope; did you mean 'main'?
   25 |   printf("%d %d",max,min);
      |                      ^~~
      |                      main
Language: C

#include <stdio.h>
int main(void){

int N;
int A;
int B;
int max,min;

scanf_s(“%d %d %d”,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:1: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 | scanf_s(“%d %d %d”,&N,&A,&B);
      | ^~~~~~~
      | scanf
main.c:9:9: error: stray '\342' in program
    9 | scanf_s(<U+201C>%d %d %d<U+201D>,&N,&A,&B);
      |         ^~~~~~~~
main.c:9:10: error: expected expression before '%' token
    9 | scanf_s(“%d %d %d”,&N,&A,&B);
      |          ^
main.c:9:18: error: stray '\342' in program
    9 | scanf_s(<U+201C>%d %d %d<U+201D>,&N,&A,&B);
      |                         ^~~~~~~~
main.c:31:8: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |        ^~~~~~~~
main.c:31:9: error: expected expression before '%' token
   31 | printf(“%d %d”,max,min);
      |         ^
main.c:31:14: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |                     ^~~~~~~~
Language: C++

void Calc_num(int a, int b, int ma) {
	if (a <= b) {
		ma = a;
	}
	else {
		ma = b;
	}
}

int main(void)
{
	int N = 0;  // 調査対象者
	int A = 0;  // 新聞X購読者数
	int B = 0;  // 新聞Y購読者数
	int max = 0;  // 両新聞の最大購読者数
	int min = 0;  // 両新聞の最小購読者数

	std::cout << "調査対象者、新聞X購読者数、新聞Y購読者数を入力してください" << std::endl;
	std::cin >> N >> A >> B;

	if (1 <= N && N <= 100) {
		if (0 < A && A <= N) {
			if (0 < B && B <= N) {
				if (A == N && B == N) {
					max = N;
					min = N;
				}
				else if(A + B <= N){
					min = 0;
					Calc_num(A, B, max);
				}
				else {
					min = A + B - N;
					Calc_num(A, B, max);
				}
			}
		}
	}

	//  結果の出力
	std::cout << A << " " << B << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: 'cout' is not a member of 'std'
   18 |         std::cout << "調査対象者、新聞X購読者数、新聞Y購読者数を入力してください" << std::endl;
      |              ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | void Calc_num(int a, int b, int ma) {
a.cc:18:91: error: 'endl' is not a member of 'std'
   18 |         std::cout << "調査対象者、新聞X購読者数、新聞Y購読者数を入力してください" << std::endl;
      |                                                                                           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | void Calc_num(int a, int b, int ma) {
a.cc:19:14: error: 'cin' is not a member of 'std'
   19 |         std::cin >> N >> A >> B;
      |              ^~~
a.cc:19:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:14: error: 'cout' is not a member of 'std'
   41 |         std::cout << A << " " << B << std::endl;
      |              ^~~~
a.cc:41:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:44: error: 'endl' is not a member of 'std'
   41 |         std::cout << A << " " << B << std::endl;
      |                                            ^~~~
a.cc:41:44: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout  << min(a, b) << " ";
    if(a + b > n) cout << a + b - n << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:10:45: error: expected '}' at end of input
   10 |     if(a + b > n) cout << a + b - n << endl;
      |                                             ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<bits.stdc++.h>
using namespace std;
int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	printf("%d %d\n", min(a, b), max(0, a + b - n));
	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<bits/stdc++.h>

using namespace std;

int main() {
   int n,a,b;
   cin >> n >> a >> b;

  if(a+b < n){
     cout << (a>b ? b : a) << " 0" << endl;
  }else if(a+b == n){
     cout << (a>b ? b : a) << " 0" << endl;
  }else if(a+b > n){@
     cout << (a>b ? b : a) << ' ' << a+b - n << endl;
  }
   return 0;
}


Compiler output:
a.cc:13:21: error: stray '@' in program
   13 |   }else if(a+b > n){@
      |                     ^
Language: C

#include <stdio.h>
int main(void){

int N;
int A;
int B;
int max,min;

scanf(“%d %d %d”,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:7: error: stray '\342' in program
    9 | scanf(<U+201C>%d %d %d<U+201D>,&N,&A,&B);
      |       ^~~~~~~~
main.c:9:8: error: expected expression before '%' token
    9 | scanf(“%d %d %d”,&N,&A,&B);
      |        ^
main.c:9:16: error: stray '\342' in program
    9 | scanf(<U+201C>%d %d %d<U+201D>,&N,&A,&B);
      |                       ^~~~~~~~
main.c:31:8: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |        ^~~~~~~~
main.c:31:9: error: expected expression before '%' token
   31 | printf(“%d %d”,max,min);
      |         ^
main.c:31:14: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |                     ^~~~~~~~
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	int n,a,b;
	int ma,mi;
	scanf("%d %d %d",&n,&a,&b);
	ma=min(a,b);
	if(n-a-b>0)min=n-a-b;
	else min=0;
	printf("%d %d\n",ma,mi);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: overloaded function with no contextual type information
    9 |         if(n-a-b>0)min=n-a-b;
      |                            ^
a.cc:10:18: error: overloaded function with no contextual type information
   10 |         else min=0;
      |                  ^
Language: C++

#include <stdio.h>
int main(void){

int N;
int A;
int B;
int max,min;

scanf(“%d %d %d”,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

Compiler output:
a.cc:9:7: error: extended character “ is not valid in an identifier
    9 | scanf(“%d %d %d”,&N,&A,&B);
      |       ^
a.cc:9:15: error: extended character ” is not valid in an identifier
    9 | scanf(“%d %d %d”,&N,&A,&B);
      |               ^
a.cc:31:8: error: extended character “ is not valid in an identifier
   31 | printf(“%d %d”,max,min);
      |        ^
a.cc:31:13: error: extended character ” is not valid in an identifier
   31 | printf(“%d %d”,max,min);
      |             ^
a.cc: In function 'int main()':
a.cc:9:7: error: '\U0000201c' was not declared in this scope
    9 | scanf(“%d %d %d”,&N,&A,&B);
      |       ^
a.cc:9:9: error: 'd' was not declared in this scope
    9 | scanf(“%d %d %d”,&N,&A,&B);
      |         ^
a.cc:9:15: error: 'd\U0000201d' was not declared in this scope
    9 | scanf(“%d %d %d”,&N,&A,&B);
      |               ^~
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main() {
   string A, B, C;
  cin >> A >> B >> C;
  int N,count,i;
  cin >> N ;
   count = 0;
   for(i=0;i<N;i++){
if(A.substr(i+1,1) != B.substr(i+1,1) && A.substr(i+1,1) != C.substr(i+1,1) && B.substr(i+1,1) != C.substr(i+1,1))
{
count = count + 1;          		
}

if(A.substr(i+1,1) != B.substr(i+1,1) || A.substr(i+1,1) || C.substr(i+1,1) || B.substr(i+1,1) != C.substr(i+1,1))
{count = count + 1;          		   
   }

   }
  
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:39: error: no match for 'operator||' (operand types are 'bool' and 'std::__cxx11::basic_string<char>')
   17 | if(A.substr(i+1,1) != B.substr(i+1,1) || A.substr(i+1,1) || C.substr(i+1,1) || B.substr(i+1,1) != C.substr(i+1,1))
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~
      |                    |                             |
      |                    bool                          std::__cxx11::basic_string<char>
a.cc:17:39: note: candidate: 'operator||(bool, bool)' (built-in)
   17 | if(A.substr(i+1,1) != B.substr(i+1,1) || A.substr(i+1,1) || C.substr(i+1,1) || B.substr(i+1,1) != C.substr(i+1,1))
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:17:39: note:   no known conversion for argument 2 from 'std::__cxx11::basic_string<char>' to 'bool'
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	int n,a,b;
	int ma,min;
	scanf("%d %d %d",&n,&a,&b);
	ma=max(a,b);
	if(n-a-b>0)min=n-a-b;
	else min=0;
	printf("%d %d\n",max,min);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: overloaded function with no contextual type information
   11 |         printf("%d %d\n",max,min);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  int N, A, B;
  int max, min;
  cin >> N >> A >> B;
  
  if(A > B) { max = A;}
  if else (B > A) {max = B;}
  if else (A == B) {max = B;}
 
  cout << max << " " << 0;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected '(' before 'else'
   10 |   if else (B > A) {max = B;}
      |      ^~~~
      |      (
a.cc:11:6: error: expected '(' before 'else'
   11 |   if else (A == B) {max = B;}
      |      ^~~~
      |      (
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	int n,a,b;
	int max,min;
	scanf("%d %d %d",&n,&a,&b);
	max=max(a,b);
	if(n-a-b>0)min=n-a-b;
	else min=0;
	printf("%d %d\n",max,min);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'max' cannot be used as a function
    8 |         max=max(a,b);
      |             ~~~^~~~~
Language: C++

#include<stdio.h>
#include<iostream>
int main(){
	int n,a,b;
	int max,min;
	scanf("%d %d %d",&n,&a,&b);
	max=max(a,b);
	if(n-a-b>0)min=n-a-b;
	else min=0;
	printf("%d %d\n",max,min);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'max' cannot be used as a function
    7 |         max=max(a,b);
      |             ~~~^~~~~
Language: C

#include <stdio.h>
int main(void){

int N;
int A;
int B;
int max,min;

scanf(%d %d %d,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:7: error: expected expression before '%' token
    9 | scanf(%d %d %d,&N,&A,&B);
      |       ^
main.c:31:8: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |        ^~~~~~~~
main.c:31:9: error: expected expression before '%' token
   31 | printf(“%d %d”,max,min);
      |         ^
main.c:31:14: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |                     ^~~~~~~~
Language: Java

import java.io.*;

Class Subscribers{

     public static void main(String []args) throws IOException {
        
        try{
        
        
            //格納(N A B)
            int n = 0;
            int a = 0;
            int b = 0;
            
            for(int i = 0; i < 3; i++){
                
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                int num = Integer.parseInt(br.readLine());
                
                switch(i){
                    case 0:
                        n = num;
                    case 1:
                        a = num;
                    case 2:
                        b = num;
                    
                 }
               }
            
            int max = 0;
            int min = 0;
            
            //max算出
            if(a <= b){
                max = a;
            }else{
                max = b;
            }
            
            //min算出
            int tmp = a + b - n;
            
            if(tmp >= 0){
                min = tmp;
            }else{
                min = 0;
            }
            
            System.out.println( max + " " + min );
            
        
         }catch(Exception e){
        
           System.out.println(e); 
           
         }
     }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
Class Subscribers{
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
     public static void main(String []args) throws IOException {
                   ^
  (use --enable-preview to enable unnamed classes)
Main.java:60: error: class, interface, enum, or record expected
}
^
3 errors
Language: C

#include <stdio.h>
int main(void){

int N>=1,N<=100;
int A>=0,A<=N;
int B>=0,B<=N;
int max,min;

scanf(%d %d %d,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    4 | int N>=1,N<=100;
      |      ^~
main.c:4:6: error: expected expression before '>=' token
main.c:5:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    5 | int A>=0,A<=N;
      |      ^~
main.c:5:6: error: expected expression before '>=' token
main.c:6:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
    6 | int B>=0,B<=N;
      |      ^~
main.c:6:6: error: expected expression before '>=' token
main.c:9:7: error: expected expression before '%' token
    9 | scanf(%d %d %d,&N,&A,&B);
      |       ^
main.c:10:4: error: 'A' undeclared (first use in this function)
   10 | if(A<B&&N>=A+B){
      |    ^
main.c:10:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:6: error: 'B' undeclared (first use in this function)
   10 | if(A<B&&N>=A+B){
      |      ^
main.c:10:9: error: 'N' undeclared (first use in this function)
   10 | if(A<B&&N>=A+B){
      |         ^
main.c:31:8: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |        ^~~~~~~~
main.c:31:9: error: expected expression before '%' token
   31 | printf(“%d %d”,max,min);
      |         ^
main.c:31:14: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |                     ^~~~~~~~
Language: C++

#include<stdio.h>


int main()
{
	int p = 0;
	int a = 0;
	int b = 0;
	int y = 0;
	int n = 0;
	int s = 0;
	
	scanf_s("%d",&p);
	scanf_s("%d",&a);
	scanf_s("%d",&b);

	if (a < b) {
		y = a;
	}
	else {
		y = b;
	}
	
	s = a + b;
	n = s - p;
	if (n < 0) {
		n = 0;
	}
	printf("%d %d\n", y, n);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |         scanf_s("%d",&p);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N, A, B;
  int max, min;
  cin >> N >> A >> B ;
  if(A > B) { max = A};
  elif (B > A) { max =B};
  else {max = A};

  cout << max << " " << 0;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before '}' token
    8 |   if(A > B) { max = A};
      |                      ^
      |                      ;
a.cc:9:3: error: 'elif' was not declared in this scope
    9 |   elif (B > A) { max =B};
      |   ^~~~
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else {max = A};
      |   ^~~~
a.cc:10:16: error: expected ';' before '}' token
   10 |   else {max = A};
      |                ^
      |                ;
Language: C++

#include <pch.h>
#include <iostream>
#include<stdio.h>


int main()
{
	int p = 0;
	int a = 0;
	int b = 0;
	int y = 0;
	int n = 0;
	int s = 0;
	
	scanf_s("%d",&p);
	scanf_s("%d",&a);
	scanf_s("%d",&b);

	if (a < b) {
		y = a;
	}
	else {
		y = b;
	}
	
	s = a + b;
	n = s - p;
	if (n < 0) {
		n = 0;
	}
	printf("%d %d\n", y, n);
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include <pch.h>
      |          ^~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
int main(void){

int 1<=N,N<=100;
int 0<=A,A<=N;
int 0<=B,B<=N;
int max,min;

scanf(%d %d %d,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:5: error: expected identifier or '(' before numeric constant
    4 | int 1<=N,N<=100;
      |     ^
main.c:5:5: error: expected identifier or '(' before numeric constant
    5 | int 0<=A,A<=N;
      |     ^
main.c:6:5: error: expected identifier or '(' before numeric constant
    6 | int 0<=B,B<=N;
      |     ^
main.c:9:7: error: expected expression before '%' token
    9 | scanf(%d %d %d,&N,&A,&B);
      |       ^
main.c:10:4: error: 'A' undeclared (first use in this function)
   10 | if(A<B&&N>=A+B){
      |    ^
main.c:10:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:6: error: 'B' undeclared (first use in this function)
   10 | if(A<B&&N>=A+B){
      |      ^
main.c:10:9: error: 'N' undeclared (first use in this function)
   10 | if(A<B&&N>=A+B){
      |         ^
main.c:31:8: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |        ^~~~~~~~
main.c:31:9: error: expected expression before '%' token
   31 | printf(“%d %d”,max,min);
      |         ^
main.c:31:14: error: stray '\342' in program
   31 | printf(<U+201C>%d %d<U+201D>,max,min);
      |                     ^~~~~~~~
Language: Java

import java.io.*;

public Class Main{

     public static void main(String []args) throws IOException {
        
        try{
        
        
            //格納(N A B)
            int n = 0;
            int a = 0;
            int b = 0;
            
            for(int i = 0; i < 3; i++){
                
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                int num = Integer.parseInt(br.readLine());
                
                switch(i){
                    case 0:
                        n = num;
                    case 1:
                        a = num;
                    case 2:
                        b = num;
                    
                 }
               }
            
            int max = 0;
            int min = 0;
            
            //max算出
            if(a <= b){
                max = a;
            }else{
                max = b;
            }
            
            //min算出
            int tmp = a + b - n;
            
            if(tmp >= 0){
                min = tmp;
            }else{
                min = 0;
            }
            
            System.out.println( max + " " + min );
            
        
         }catch(Exception e){
        
           System.out.println(e); 
           
         }
     }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Class Main{
       ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
     public static void main(String []args) throws IOException {
                   ^
  (use --enable-preview to enable unnamed classes)
Main.java:60: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

int main() {
	int N, A, B, min, max, sa;
	cin >> N;
	cin >> A;
	cin >> B;

	min = A + B - N;
	if (min < 0) min = 0;

	if ((A-B) > 0) {
		max = B;
	} else {
	 	max = A;
	}

	printf("%d %d\n", max, min);

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope; did you mean 'min'?
    3 |         cin >> N;
      |         ^~~
      |         min
a.cc:16:9: error: 'printf' was not declared in this scope
   16 |         printf("%d %d\n", max, min);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
Language: C++

/* */

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

int main(){
	int n, a, b;
	cin >> n >> a >> b;
	int max, min;

	max = min(a,b);

	if(n < a + b) min = (a + b) - n;
	else min = 0;

    cout << max << endl << min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: 'min' cannot be used as a function
   12 |         max = min(a,b);
      |               ~~~^~~~~
Language: Java

import java.io.*;

public class Subscribers{

     public static void main(String []args) throws IOException {
        
        try{
        
        
            //格納(N A B)
            int n = 0;
            int a = 0;
            int b = 0;
            
            for(int i = 0; i < 3; i++){
                
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                int num = Integer.parseInt(br.readLine());
                
                switch(i){
                    case 0:
                        n = num;
                    case 1:
                        a = num;
                    case 2:
                        b = num;
                    
                 }
               }
            
            int max = 0;
            int min = 0;
            
            //max算出
            if(a <= b){
                max = a;
            }else{
                max = b;
            }
            
            //min算出
            int tmp = a + b - n;
            
            if(tmp >= 0){
                min = tmp;
            }else{
                min = 0;
            }
            
            System.out.println( max + " " + min );
            
        
         }catch(Exception e){
        
           System.out.println(e); 
           
         }
     }
}

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

#include <stdio.h>
int main(void){
    int N,a,B;
    
    scanf("%d",&N);
    scanf("%d",&A);
    scanf("%d",&B);
    
    if(N>100 || N<1)
    return 1;

    if(A>N || A<0)
    return 1;

    if(B>N || B<0)
    return 1;

    if(A>B){printf("%d %d\n", B, A-B);}
    else if(A=B){printf("%d %d\n", A, B);}
    else{printf("%d %d\n", A, B-A);}

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:17: error: 'A' undeclared (first use in this function)
    6 |     scanf("%d",&A);
      |                 ^
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <studio.h>
int main(void){

int 1<=N,N<=100;
int 0<=A,A<=N;
int 0<=B,B<=N;
int max,min;

scanf(%d %d %d,&N,&A,&B);
if(A<B&&N>=A+B){
max=A;
min=0;
}
else if(A<B&&N<=A+B){
max=A;
min=A+B-N;
}

else if(A>B&&N>=A+B){
max=B;
min=0;
}
else if(A>B&&N<=A+B){
max=B;
min=A+B-N;
}
else if(N==A==B){
max=A;
min=A;
}
printf(“%d %d”,max,min);
return 0;
}

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



#include "pch.h"
#include <iostream>
#include<stdio.h>


int main()
{
	int p = 0;
	int a = 0;
	int b = 0;
	int y = 0;
	int n = 0;
	int s = 0;
	
	scanf_s("%d",&p);
	scanf_s("%d",&a);
	scanf_s("%d",&b);

	if (a < b) {
		y = a;
	}
	else {
		y = b;
	}
	
	s = a + b;
	n = s - p;
	if (n < 0) {
		n = 0;
	}
	printf("%d %d\n", y, n);
}


Compiler output:
a.cc:3:10: fatal error: pch.h: No such file or directory
    3 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
using namespace std;
int main(){
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
	printf("%d %d\n", min(a, b), max(a+b-n, 0));
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: 'min' was not declared in this scope; did you mean 'main'?
    6 |         printf("%d %d\n", min(a, b), max(a+b-n, 0));
      |                           ^~~
      |                           main
a.cc:6:38: error: 'max' was not declared in this scope
    6 |         printf("%d %d\n", min(a, b), max(a+b-n, 0));
      |                                      ^~~
Language: Java

import java.io.*;

public class Sample1{

     public static void main(String []args) throws IOException {
        
        try{
        
        
            //格納(N A B)
            int n = 0;
            int a = 0;
            int b = 0;
            
            for(int i = 0; i < 3; i++){
                
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                int num = Integer.parseInt(br.readLine());
                
                switch(i){
                    case 0:
                        n = num;
                    case 1:
                        a = num;
                    case 2:
                        b = num;
                    
                 }
               }
            
            int max = 0;
            int min = 0;
            
            //max算出
            if(a <= b){
                max = a;
            }else{
                max = b;
            }
            
            //min算出
            int tmp = a + b - n;
            
            if(tmp >= 0){
                min = tmp;
            }else{
                min = 0;
            }
            
            System.out.println( max + " " + min );
            
        
         }catch(Exception e){
        
           System.out.println(e); 
           
         }
     }
}

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

#include<stdio.h>


int main()
{
	int p = 0;
	int a = 0;
	int b = 0;
	int y = 0;
	int n = 0;
	int s = 0;
	
	scanf_s("%d%d%d", &p,&a,&b);


	if (a < b) {
		y = a;
	}
	else {
		y = b;
	}
	
	s = a + b;
	n = s - p;
	if (n < 0) {
		n = 0;
	}
	printf("%d %d\n", y, n);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |         scanf_s("%d%d%d", &p,&a,&b);
      |         ^~~~~~~
      |         scanf
Language: C++

#include "pch.h"

#include<stdio.h>


int main()
{
	int p = 0;
	int a = 0;
	int b = 0;
	int y = 0;
	int n = 0;
	int s = 0;
	
	scanf("%d%d%d", &p,&a,&b);


	if (a < b) {
		y = a;
	}
	else {
		y = b;
	}
	
	s = a + b;
	n = s - p;
	if (n < 0) {
		n = 0;
	}
	printf("%d %d\n", y, n);
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.