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

main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a;	}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      | ^~~~
main.c: In function 'main':
main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                  ^~~~~
main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:51: error: 'EOF' undeclared (first use in this function)
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                   ^~~
main.c:1:51: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:1:51: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:59: error: 'max' undeclared (first use in this function)
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                           ^~~
main.c:1:77: error: 'min' undeclared (first use in this function); did you mean 'main'?
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                                             ^~~
      |                                                                             main
main.c:1:92: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(){float q=0,r=10000,a;while(scanf("%lf",&a)!=EOF){if(max<a){max=a; }if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                                                            ^~~~~~
main.c:1:92: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:92: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:92: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}

Compiler output:
main.c: In function 'main':
main.c:1:38: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                      ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
main.c:1:38: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                      ^~~~~
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:55: error: 'EOF' undeclared (first use in this function)
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                       ^~~
main.c:1:55: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:1:55: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:63: error: 'max' undeclared (first use in this function)
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                               ^~~
main.c:1:80: error: 'min' undeclared (first use in this function); did you mean 'main'?
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                                                ^~~
      |                                                                                main
main.c:1:95: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | float q=0,r=10000,a;int main(){while(scanf("%lf",&a)!=EOF){if(max<a){max=a;}if(min>a){min=a;}}printf("%f\n",max-min);return 0;}
      |                                                                                               ^~~~~~
main.c:1:95: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:95: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:95: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

int main(void){
	double t,ans,max,min;
	int i;
	
	max=-1.0;
	min=-1.0;
	
	while((scanf("%lf",&t))!=EOF){
		if(t>max || max<0)max=t;
		if(tminmax || max<0)max=t;
	}
	
	printf("%lf\n",max-min);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:20: error: 'tminmax' undeclared (first use in this function)
   12 |                 if(tminmax || max<0)max=t;
      |                    ^~~~~~~
main.c:12:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
    double h,l,i,j;
    printf("%lf%lf",&h,&l);
    if(h<l){
        d=h;
        h=l;
        l=d;
    }
    while(scanf("%lf",&i)!=EOF){
        if(h<i){
            d=h;
            h=i;
            i=d;
        }
        if(l>i){
            d=l;
            l=i;
            i=d;
        }
    }
    printf("%f\n",h-l);
    return 0;
}

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

#include<iostream>
using namespace std;
int main() {
	long float syo, dai, c;
	dai = -1;
	syo = 1999999;
	while (cin >> c) {
		if (dai <= c) {
			dai = c;
		}
		if (syo >= c) {
			syo = c;
		}
	}
	cout << dai - syo << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'long' specified with 'float'
    4 |         long float syo, dai, c;
      |         ^~~~
a.cc:4:9: error: 'long' specified with 'float'
a.cc:4:9: error: 'long' specified with 'float'
Language: C++

#include <iostream>
#include <vector>
int main()
{
	double 			input;
	std::vector<double> 	height;
	while (std::cin >> input) {
		height.push_back(input);
	}
	std::sort(height.begin(), height.end());
	std::cout << *(height.end()-1) - *(height.begin()) << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   10 |         std::sort(height.begin(), height.end());
      |              ^~~~
      |              qsort
Language: C++

#include <iostream>
#include <vector>
int main()
{
	double 			input;
	std::vector<double> 	height;
	while (std::cin >> input) {
		height.push_back(input);
	}
	sort(height.begin(), height.end());
	std::cout << *(height.end()-1) - *(height.begin()) << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |         sort(height.begin(), height.end());
      |         ^~~~
      |         short
Language: C++

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

int main(){
  double mountain[1111],ans;
  int i=0;
  while(cin >> mountain[i]){
    i++;
  }
  sort(mountain,mountain+i);
  ans = mountain[i-1] - mountain[0];
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   11 |   sort(mountain,mountain+i);
      |   ^~~~
      |   sqrt
Language: C++

#include <cstdio>
#include <cmath>
using namespace std;
double m,h,l;
int main()
{
    while(~scanf("%lf",&m) {
        h=max(m,h);
        l=min(m,l);
    }
    printf("%f\n",fabs(h-l));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: expected ')' before '{' token
    7 |     while(~scanf("%lf",&m) {
      |          ~                ^~
      |                           )
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
double m,h,l;
int main()
{
    while(~scanf("%lf",&m) {
        h=max(m,h);
        l=min(m,l);
    }
    printf("%f\n",fabs(h-l));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: expected ')' before '{' token
    8 |     while(~scanf("%lf",&m) {
      |          ~                ^~
      |                           )
Language: C++

#include <cstdio>
#include <cmath>
#include <climits>
#include <algorithm>

using namespace std;

double m,h,l;

int main()
{
    while(~scanf("%lf",&m)) {
        h=max(m,h);
        l=min(m,INT_MAX);
    }
    printf("%f\n",fabs(h-l));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: no matching function for call to 'min(double&, int)'
   14 |         l=min(m,INT_MAX);
      |           ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:14:14: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   14 |         l=min(m,INT_MAX);
      |           ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:14:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   14 |         l=min(m,INT_MAX);
      |           ~~~^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)

int main() {
	double h;
	double highest = 0;
	double lowest = INT_MAX;
	while(cin >> h) {
		if(highest < h) highest = h;
		if(lowest > h) lowest = h;
	}
	cout << highest - lowest << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'INT_MAX' was not declared in this scope
   11 |         double lowest = INT_MAX;
      |                         ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <cstdio>
  +++ |+#include <climits>
    3 |
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);
    double max = 114514810, min = -1;
    double h;
    while(cin >> h) {
        max = max(max, h);
        min = min(min, h);
    } 
    cout << max - min << endl;

    return 0;
}

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

#include <cstdio>

int main()
{
  double n, h = 0.0, l = 999999999.0;
  int i = 5;

  while (i--){
    scanf("%f", &n);
    h = max(h, n);
    l = min(l, n);
  }

  printf("%.1f\n", h - l);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'max' was not declared in this scope
   10 |     h = max(h, n);
      |         ^~~
a.cc:11:9: error: 'min' was not declared in this scope; did you mean 'main'?
   11 |     l = min(l, n);
      |         ^~~
      |         main
Language: C++

#include <cstdio>

using namespace std;

int main()
{
  double n, h = 0.0, l = 999999.0;

  while (scanf("%lf", &n)){
    h = max(h, n);
    l = min(l, n);
  }

  printf("%.1lf\n", h - l);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'max' was not declared in this scope
   10 |     h = max(h, n);
      |         ^~~
a.cc:11:9: error: 'min' was not declared in this scope; did you mean 'main'?
   11 |     l = min(l, n);
      |         ^~~
      |         main
Language: C++

#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <climits>
#include <map>
#include <stack>
using namespace std;
#define M_PI 3.141592
#define toRad 2.0*M_PI/360.0
#define inin(x) int x;cin>>x;
#define all(x) x.begin(),x.end()
#define debug(x) cout<<#x<<" "<<x<<endl;
#define rep(i,n) for(int i=0;i<(int)n;i++)
typedef pair<int, int> pii;

int main()
{
	double mi, ma, x;
	ma = DBL_MIN; mi = DBL_MAX;
	while (cin >> x)
	{
		ma = max(ma, x);
		mi = min(mi, x);
	}
	printf("%lf\n", ma - mi);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'DBL_MIN' was not declared in this scope
   26 |         ma = DBL_MIN; mi = DBL_MAX;
      |              ^~~~~~~
a.cc:14:1: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   13 | #include <stack>
  +++ |+#include <cfloat>
   14 | using namespace std;
a.cc:26:28: error: 'DBL_MAX' was not declared in this scope
   26 |         ma = DBL_MIN; mi = DBL_MAX;
      |                            ^~~~~~~
a.cc:26:28: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

int main() {
    double highest = INT_MIN;
    double lowest = INT_MAX;
    double h;
    while(cin >> h) {
        highest = max(highest, h);
        lowest = min(lowest, h);
    }
    printf("%.3f\n", highest- lowest);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: 'INT_MIN' was not declared in this scope
   17 |     double highest = INT_MIN;
      |                      ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <map>
  +++ |+#include <climits>
    9 | using namespace std;
a.cc:18:21: error: 'INT_MAX' was not declared in this scope
   18 |     double lowest = INT_MAX;
      |                     ^~~~~~~
a.cc:18:21: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
using namespace std;
int main(){
	double h, min = 0.0, max = 0.0;
	while(cin >> h){
		if( h > max ) max = h;
		else if( h < min ) min = h;
	}
	cout << fixed << setprecision(1) << max - min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: 'setprecision' was not declared in this scope
    9 |         cout << fixed << setprecision(1) << max - min << endl;
      |                          ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

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

int main(){
	double h;
	vector<double>vh;
	vector<double>::iterator pvh=vh.begin();
	while(cin>>h){
		vh.push_back(h);		
		}
		sort(vh.begin(),vh.end());
		double a,b,c;
		double a=*pvh;
		pvh=vh.end();
		double b=*pvh;
		double c=b-a;
		cout<<c<<endl;
		
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'double a'
   13 |                 double a=*pvh;
      |                        ^
a.cc:12:24: note: 'double a' previously declared here
   12 |                 double a,b,c;
      |                        ^
a.cc:15:24: error: redeclaration of 'double b'
   15 |                 double b=*pvh;
      |                        ^
a.cc:12:26: note: 'double b' previously declared here
   12 |                 double a,b,c;
      |                          ^
a.cc:16:24: error: redeclaration of 'double c'
   16 |                 double c=b-a;
      |                        ^
a.cc:12:28: note: 'double c' previously declared here
   12 |                 double a,b,c;
      |                            ^
Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication26
{
    class Program
    {
        static void Main(string[] args)
        {
            double b, c;
            c=0;b=1<<29;
            string line;
            while((line=Console.ReadLine())!=null)
            {
                double a = double.Parse(line);
                if (b < a)
                    b = a;
                if (c > a)
                    c = a;
            }
            Console.WriteLine(b - c);
        }
    }
}
 
 

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:10:26: error: 'string' has not been declared
   10 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:10:35: error: expected ',' or '...' before 'args'
   10 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:25:6: error: expected ';' after class definition
   25 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApplication26::Program::Main(int*)':
a.cc:14:13: error: 'string' was not declared in this scope
   14 |             string line;
      |             ^~~~~~
a.cc:15:20: error: 'line' was not declared in this scope
   15 |             while((line=Console.ReadLine())!=null)
      |                    ^~~~
a.cc:15:25: error: 'Console' was not declared in this scope
   15 |             while((line=Console.ReadLine())!=null)
      |                         ^~~~~~~
a.cc:15:46: error: 'null' was not declared in this scope
   15 |             while((line=Console.ReadLine())!=null)
      |                                              ^~~~
a.cc:17:28: error: expected primary-expression before 'double'
   17 |                 double a = double.Parse(line);
      |                            ^~~~~~
a.cc:23:13: error: 'Console' was not declared in this scope
   23 |             Console.WriteLine(b - c);
      |             ^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;

int main() {
  double heights[50];

  int i = 0;
  while(cin >> heights[i]) {
    i++;
  }

  double min_f = *min_element(heights, heights + i);
  double max_f = *max_element(heights, heights + i);

  printf("%.6lf\n", max_f - min_f);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'min_element' was not declared in this scope
   14 |   double min_f = *min_element(heights, heights + i);
      |                   ^~~~~~~~~~~
a.cc:15:19: error: 'max_element' was not declared in this scope
   15 |   double max_f = *max_element(heights, heights + i);
      |                   ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    vector<double> a;
    double x;
    while (~scanf("%f", &x)){
        a.push_back(x);
    }
    double mi = 1e9; ma = 0;
    REP(i,a.size()){
        mi = fmin(mi, a[i]);
        ma = fmax(ma, a[i]);
    }
    cout << ma - mi << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:22: error: 'ma' was not declared in this scope; did you mean 'mi'?
   32 |     double mi = 1e9; ma = 0;
      |                      ^~
      |                      mi
Language: C++

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

int main(){
  double n;
  vector<double> vec;
  while (cin >> n){
    vec.push_back();
  }
  sort(vec.begin(), vec.end());
  double ans = vec.back() - vec.front();
  cout << fixed << setprecision(3) << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: no matching function for call to 'std::vector<double>::push_back()'
    8 |     vec.push_back();
      |     ~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = double; _Alloc = std::allocator<double>; value_type = double]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = double; _Alloc = std::allocator<double>; value_type = double]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<iostream.h>
int main(){double l,m,n=1e5;for(;cin>>l;m<l?m=l:l,n>l?n=l:l);cout<<m-n<<endl;}

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

main(){
	double max=0,min=1e9,h;
	while(~scanf("%lf",&h)){
		if(max<h)	max=h;
		if(min>h)	min=h;
	}
	printf("%f\n",max-min);
	exit(0);
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:16: error: 'scanf' was not declared in this scope
    3 |         while(~scanf("%lf",&h)){
      |                ^~~~~
a.cc:7:9: error: 'printf' was not declared in this scope
    7 |         printf("%f\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 | main(){
a.cc:8:9: error: 'exit' was not declared in this scope
    8 |         exit(0);
      |         ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | main(){
Language: C++

#include <stdio.h>
#include <vector>
using namespace std;

int main(){
	vector<double> h;
	double n;

	while( scanf("%lf", &n) != EOF ){
		h.push_back(n);
	}
	sort( h.begin() , h.end() );
	int i = h.size()-1;
	printf("%.1f\n", h[i]-h[0]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort( h.begin() , h.end() );
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <cstdio>
int main(){
	double i=1e+64,a=0,t;
	while(std::cin>>t){
		if(t<i)i=t;
		if(t>a)a=t;
	}
	printf("%f\n", maxi-mini);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'maxi' was not declared in this scope
    9 |         printf("%f\n", maxi-mini);
      |                        ^~~~
a.cc:9:29: error: 'mini' was not declared in this scope
    9 |         printf("%f\n", maxi-mini);
      |                             ^~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>


using namespace std;


int main()
{
	double ma = DBL_MIN;
	double mi = DBL_MAX;
	double al;
	while (scanf("%lf", &al) != EOF)
	{
		if (al > ma)
			ma = al;
		if (al < mi)
			mi = al;
	}

	printf("%.1f\n", ma-mi);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'DBL_MIN' was not declared in this scope
   18 |         double ma = DBL_MIN;
      |                     ^~~~~~~
a.cc:11:1: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   10 | #include <iostream>
  +++ |+#include <cfloat>
   11 | 
a.cc:19:21: error: 'DBL_MAX' was not declared in this scope
   19 |         double mi = DBL_MAX;
      |                     ^~~~~~~
a.cc:19:21: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>
#include <climits>


using namespace std;


int main()
{
	double ma = DBL_MIN;
	double mi = DBL_MAX;
	double al;
	while (scanf("%lf", &al) != EOF)
	{
		if (al > ma)
			ma = al;
		if (al < mi)
			mi = al;
	}

	printf("%.1f\n", ma-mi);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: 'DBL_MIN' was not declared in this scope
   19 |         double ma = DBL_MIN;
      |                     ^~~~~~~
a.cc:12:1: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   11 | #include <climits>
  +++ |+#include <cfloat>
   12 | 
a.cc:20:21: error: 'DBL_MAX' was not declared in this scope
   20 |         double mi = DBL_MAX;
      |                     ^~~~~~~
a.cc:20:21: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
Language: C++

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String args[]) {
		ArrayList<Double> al = new ArrayList<Double>();
		while(sc.hasNext()) {
			al.add(sc.nextDouble());
		}
		System.out.println(Collections.max(al) - Collections.min(al));
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
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++

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

int main(){
  double xmax=0,xmin=INT_MAX,ans,n[100000];

  int i=0;
  while(cin >> n[i]){
    xmax=max(xmax,n[i]);
    xmin=min(xmin,n[i]);
    i++;
}

  cout << xmax-xmin << endl;





}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: 'INT_MAX' was not declared in this scope
    7 |   double xmax=0,xmin=INT_MAX,ans,n[100000];
      |                      ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:10:16: error: 'n' was not declared in this scope
   10 |   while(cin >> n[i]){
      |                ^
Language: C++

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

int main(){
    vector<double> height;
    double tmp;

    while(cin >> tmp){
        height.push_back(tmp);
    }

    sort(height.begin(), height.end());

    double min;
    double max;

    min = height[0];
    max = height[height.size()-1];

    cout << max - min << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(height.begin(), height.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

double abs( double n )
{
	if ( n < 0 )
	{
		return -n;
	}
	else
	{
		return n;
	}
}

int main()
{
	vector<double> height;

	double input;

	while ( cin >> input )
	{
		height.push_back( input );
	}

	sort( height.begin(), height.end() );

	cout << abs( *height.begin() - *height.rbegin() ) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:20: error: call of overloaded 'abs(double)' is ambiguous
   43 |         cout << abs( *height.begin() - *height.rbegin() ) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:18:8: note: candidate: 'double abs(double)'
   18 | double abs( double n )
      |        ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

//0046
int main(){
	double h;
	vector<double> height;

	while(cin >> h){
		if(cin.eof())break;
		height.push_back(h);
	}

	sort(height.begin(),height.end());
	double diff = height[height.back()] - height[height.front()];
	cout << diff << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: expected '}' at end of input
   19 |         cout << diff << endl;
      |                              ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <iostream>
 
using namespace std;
 
int main(int argc, char **argv)
{
    double max, min, tmp;
     
    cin >> max;
    min = max;
     
    while(cin >> tmp){
        if(max < tmp){
            max = tmp;
        } else (tmp < min){
            min = tmp;
        }
    }
     
    cout << (double)(max - min) << endl;
     
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:27: error: expected ';' before '{' token
   15 |         } else (tmp < min){
      |                           ^
      |                           ;
Language: C++

#include <iostream>
 
using namespace std;
 
int main(int argc, char **argv)
{
    double max, min, tmp;
     
    cin >> max;
    min = max;
     
    while(cin >> tmp){
        if(max < tmp){
            max = tmp;
        } elseif (tmp < min){
            min = tmp;
        }
    }
     
    cout << (double)(max - min) << endl;
     
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:11: error: 'elseif' was not declared in this scope
   15 |         } elseif (tmp < min){
      |           ^~~~~~
Language: C++

int main(){
  double a,tans,hans;
  cin >> a;
  tans = a;
  hans = a;
  while(cin>>a){
    if(tans>a) tans = a;
    if(hans<a) hans = a;
  }
  cout << hans - tans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> a;
      |   ^~~
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << hans - tans << endl;
      |   ^~~~
a.cc:10:26: error: 'endl' was not declared in this scope
   10 |   cout << hans - tans << endl;
      |                          ^~~~
Language: C++

#include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}

Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}
      |                         ^~~~~~~~~
a.cc:1:9: fatal error: iostream>usin: No such file or directory
    1 | #include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream> using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include<iostream> using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}
      |                    ^~~~~
/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 <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>
#include <cFloat>

using namespace std;

int main() {
	double height = 0, maxNum=0.0, minNum=DBL_MAX;
	while(cin>>height){
		if(cin.eof()) break;
		maxNum = max(maxNum, height);
		minNum = min(minNum, height);
	}
	printf("%.1f\n", maxNum-minNum);
	return 0;

}

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

#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
	double height = 0, maxNum=0.0, minNum=DBL_MAX;
	while(cin>>height){
		if(cin.eof()) break;
		maxNum = max(maxNum, height);
		minNum = min(minNum, height);
	}
	printf("%.1f\n", maxNum-minNum);
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: 'DBL_MAX' was not declared in this scope
   11 |         double height = 0, maxNum=0.0, minNum=DBL_MAX;
      |                                               ^~~~~~~
a.cc:7:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    6 | #include <cstdio>
  +++ |+#include <cfloat>
    7 |
Language: C++

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

int main(){
	vector<float> v;
	float input;
	while(cin >> input){
		v.push_back(input);
		sort(v.begin(), v.end());
		float ans;
		vector<float>::iterator ite;
		ite = v.end();
		ans = *(ite-1) - v.at(0);
		
	}
	printf("%.1f\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |         printf("%.1f\n", ans);
      |                          ^~~
      |                          abs
Language: Java

import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int[] ball={1,0,0};
while((line=br.readLine())!=null){
char[] c=line.toCharArray();
reverse(c[0],c[2],ball);
}
for(int i=0;i<ball.length;i++){
if(ball[i]==1){
System.out.println(String.valueOf((char)('A'+1));
}
}
}
private static void reverse(char c1,char c2,final int[] ball){
int a=ball[c1-'A'+1];
ball[c1-'A'+1]=ball[c2-'A'+1];
ball[c2-'A'+1]=a;
}
}

Compiler output:
Main.java:14: error: ')' or ',' expected
System.out.println(String.valueOf((char)('A'+1));
                                                ^
1 error
Language: Java

import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int[] ball={1,0,0};
while((line=br.readLine())!=null){
char[] c=line.toCharArray();
reverse(c[0],c[2],ball);
}
for(int i=0;i<ball.length;i++){
if(ball[i]==1){
switch(i){
case 0:System.out.println("A");
case 1:System.out.println("B");
case 2:System.out.println("C");
}
}
}
private static void reverse(char c1,char c2,final int[] ball){
int a=ball[c1-'A'+1];
ball[c1-'A'+1]=ball[c2-'A'+1];
ball[c2-'A'+1]=a;
}
}

Compiler output:
Main.java:21: error: illegal start of expression
private static void reverse(char c1,char c2,final int[] ball){
^
1 error
Language: Java

package field;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Field {

    public static void main(String[] args) {

        Map<String, Integer> toIndex = new HashMap<>();
        toIndex.put("A", 0);
        toIndex.put("B", 1);
        toIndex.put("C", 2);

        Map<Integer, String> toAlphabet = new HashMap<>();
        toAlphabet.put(0, "A");
        toAlphabet.put(1, "B");
        toAlphabet.put(2, "C");

        int[] cap = {1, 0, 0};

        List<String[]> splitedString = read(",");
        for(String[] stringLine : splitedString) {
            swap(cap, toIndex.get(stringLine[0]), toIndex.get(stringLine[1]));
        }

        for(int cur = 0; cur < cap.length; cur++) {
            if(cap[cur] == 1) {
                System.out.println(toAlphabet.get(cur));
            }
        }
    }

    private static void swap(int[] array, int leftIndex, int rightIndex) {
        int temp = array[leftIndex];
        array[leftIndex] = array[rightIndex];
        array[rightIndex] = temp;
    }

    public static List<String[]> read(String delim) {
        Scanner scanner = new Scanner(System.in);
        List<String[]> splitedStringArray = new ArrayList<>();

        while (scanner.hasNext()) {
            splitedStringArray.add(scanner.nextLine().split(delim));
        }
        scanner.close();

        return splitedStringArray;
    }
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	
	public static void main(String[] args) {

		try {
	
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			String answer = "A";
			
			String[] params = null;
			String question = null;

			while (questionreader.ready()) {
				if ("".equals(question = questionreader.readLine())) break;
				params = question.split(",");
				if (answer.equals(params[0])) answer = params[1];
				else if (answer.equals(params[1])) answer = params[0];
			}
			
			answerwriter.println(answer);
			
			answerwriter.close();
			questionreader.close();
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}
}

Compiler output:
Main.java:32: error: cannot find symbol
		} catch (FileNotFoundException e) {
		         ^
  symbol:   class FileNotFoundException
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	
	public static void main(String[] args) {

		try {
	
//			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
//			PrintWriter answerwriter = new PrintWriter(System.out);

			String answer = "A";
			
			String[] params = null;
			String question = null;

			while (questionreader.ready()) {
				if ("".equals(question = questionreader.readLine())) break;
				params = question.split(",");
				if (answer.equals(params[0])) answer = params[1];
				else if (answer.equals(params[1])) answer = params[0];
			}
			
			answerwriter.println(answer);
			
			answerwriter.close();
			questionreader.close();
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}
}

Compiler output:
Main.java:25: error: cannot find symbol
			while (questionreader.ready()) {
			       ^
  symbol:   variable questionreader
  location: class Main
Main.java:26: error: cannot find symbol
				if ("".equals(question = questionreader.readLine())) break;
				                         ^
  symbol:   variable questionreader
  location: class Main
Main.java:32: error: cannot find symbol
			answerwriter.println(answer);
			^
  symbol:   variable answerwriter
  location: class Main
Main.java:34: error: cannot find symbol
			answerwriter.close();
			^
  symbol:   variable answerwriter
  location: class Main
Main.java:35: error: cannot find symbol
			questionreader.close();
			^
  symbol:   variable questionreader
  location: class Main
5 errors
Language: Java

package volume00.set0040;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class P0047 {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		char current = 'A';
		while ((line = br.readLine()) != null) {
			if (line.charAt(0) == current || line.charAt(2) == current)
				current = line.charAt(0) == current ? line.charAt(2) : line
						.charAt(0);
		}
		System.out.println(current);
	}
}

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

#include <stdio.h>
??
int main() {
????????char cup = 'A';
????????char a, b;
????????while (scanf("%c,%c", &a, &b) != EOF) {
????????????????if (a == cup) {
????????????????????????cup = b;
????????????????}
????????????????else if (b == cup) {
????????????????????????cup = a;
????????????????}
????????}
????????printf("%c\n", cup);
????????return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^