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

main(){
  int t[99];
  int r[99];
  int sum=0;
  int i=0;
  double n=0;

  while(scanf("%d,%d",&t[i],&r[i])!=EOF){
    sum=sum+t[i]*r[i];
    n=n+r[i++];
  }
  printf("%d\n%.0f\n",sum,round(n/i));
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   while(scanf("%d,%d",&t[i],&r[i])!=EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:8:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   while(scanf("%d,%d",&t[i],&r[i])!=EOF){
      |         ^~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:37: error: 'EOF' undeclared (first use in this function)
    8 |   while(scanf("%d,%d",&t[i],&r[i])!=EOF){
      |                                     ^~~
main.c:8:37: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:8:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |   printf("%d\n%.0f\n",sum,round(n/i));
      |   ^~~~~~
main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:27: error: implicit declaration of function 'round' [-Wimplicit-function-declaration]
   12 |   printf("%d\n%.0f\n",sum,round(n/i));
      |                           ^~~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'round'
  +++ |+#include <math.h>
    1 | main(){
main.c:12:27: warning: incompatible implicit declaration of built-in function 'round' [-Wbuiltin-declaration-mismatch]
   12 |   printf("%d\n%.0f\n",sum,round(n/i));
      |                           ^~~~~
main.c:12:27: note: include '<math.h>' or provide a declaration of 'round'
Language: C

#include<stdio.h>
int main(){
	int a,b,sum=0,nsum=0,n
	for(n=0;;n++){
		if(scanf("%d,%d",a,b) == EOF){break;}
		sum+=a*b;
		nsum+=b;
	}
	printf("%d\n%d\n",sum,nsum/n);
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    4 |         for(n=0;;n++){
      |         ^~~
main.c:4:18: error: 'n' undeclared (first use in this function)
    4 |         for(n=0;;n++){
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:21: error: expected ';' before ')' token
    4 |         for(n=0;;n++){
      |                     ^
      |                     ;
main.c:4:21: error: expected statement before ')' token
main.c:5:47: error: break statement not within loop or switch
    5 |                 if(scanf("%d,%d",a,b) == EOF){break;}
      |                                               ^~~~~
Language: C

#include<stdio.h>
int main(){
	int a,b,sum=0,nsum=0,n
	for(n=0;;n++){
		if(scanf("%d,%d",a,b) == EOF){break;}
		sum+=a*b;
		nsum+=b;
	}
	printf("%d\n%d\n",sum,nsum/n);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    4 |         for(n=0;;n++){
      |         ^~~
main.c:4:18: error: 'n' undeclared (first use in this function)
    4 |         for(n=0;;n++){
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:21: error: expected ';' before ')' token
    4 |         for(n=0;;n++){
      |                     ^
      |                     ;
main.c:4:21: error: expected statement before ')' token
main.c:5:47: error: break statement not within loop or switch
    5 |                 if(scanf("%d,%d",a,b) == EOF){break;}
      |                                               ^~~~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

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

int round(double x)
{
	if(x>=0)
		x = floor(x + 0.5);
	else
		x = -1.0 * floor(fabs(x) + 0.5);
	return (int)x;
}

int main()
{
	int a, b, sum=0, ave=0, n=0;

	while(scanf("%d,%d", &a, &b) != EOF){
		sum += a * b;
		ave += b;
		n++;
	}

	ave = round((double)ave / n);

	printf("%d\n%d\n", sum, ave);
	return 0;
}

	

Compiler output:
main.c:11:5: error: conflicting types for 'round'; have 'int(double)'
   11 | int round(double x)
      |     ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:4:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)'
  334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

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

int round(double x)
{
	if(x>=0)
		x = floor(x + 0.5);
	else
		x = -1.0 * floor(fabs(x) + 0.5);
	return x;
}


int main()
{
	int a, b, sum=0, ave=0, n=0;

	while(scanf("%d,%d", &a, &b) != EOF){
		sum += a * b;
		ave += b;
		n++;
	}

	ave = round((double)ave / n);

	printf("%d\n%d\n", sum, ave);
	return 0;
}

Compiler output:
main.c:11:5: error: conflicting types for 'round'; have 'int(double)'
   11 | int round(double x)
      |     ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:4:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)'
  334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

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

int round(double x);

int main()
{
	int a, b, sum=0, ave=0, n=0;

	while(scanf("%d,%d", &a, &b) != EOF){
		sum += a * b;
		ave += b;
		n++;
	}

	ave = round((double)ave / n);

	printf("%d\n%d\n", sum, ave);

	return 0;
}

	
int round(double x)
{
	if(x>=0)
		x = floor(x + 0.5);
	else
		x = -1.0 * floor(fabs(x) + 0.5);
	return (int)x;
}

Compiler output:
main.c:11:5: error: conflicting types for 'round'; have 'int(double)'
   11 | int round(double x);
      |     ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:4:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)'
  334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
main.c:31:5: error: conflicting types for 'round'; have 'int(double)'
   31 | int round(double x)
      |     ^~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)'
  334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

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

int round(double x);

int main()
{
	int a, b, sum=0, ave=0, n=0;

	while(scanf("%d,%d", &a, &b) != EOF){
		sum += a * b;
		ave += b;
		n++;
	}

	ave = round((double)ave / n);

	printf("%d\n%d\n", sum, ave);

	return 0;
}

	
int round(double x)
{
	int buf;
	if(x>=0)
		x = floor(x + 0.5);
	else
		x = -1.0 * floor(fabs(x) + 0.5);
	buf =  (int)x;
	return buf;
}

Compiler output:
main.c:11:5: error: conflicting types for 'round'; have 'int(double)'
   11 | int round(double x);
      |     ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:4:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)'
  334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
main.c:31:5: error: conflicting types for 'round'; have 'int(double)'
   31 | int round(double x)
      |     ^~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)'
  334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
Language: C

#include<stdio.h>
int main(){
	int x,y,a,b,count;
	x=0;
	y=0;
	count=0;
	while(scanf("%d,%d",&a,&b)=EOF){
		x=x+a*b;
		y+=b;
		count++;
	}
	y=y/count+0.5;
	printf("%d\n%d\n",x,y);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:35: error: lvalue required as left operand of assignment
    7 |         while(scanf("%d,%d",&a,&b)=EOF){
      |                                   ^
Language: C

#include<stdio.h>
int main(void){
  int g=0,c=0,a,b;
  char z;
  while(scanf("%d %c %d",&a,&z,&b)!=EOF){
    g+=a*b;c+=a;
  }

  printf("%d\n%d\n",g,(int)((1.0*g/c+0.5));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:43: error: expected ')' before ';' token
    9 |   printf("%d\n%d\n",g,(int)((1.0*g/c+0.5));
      |         ~                                 ^
      |                                           )
main.c:10:12: error: expected ';' before '}' token
   10 |   return 0;
      |            ^
      |            ;
   11 | }
      | ~
Language: C++

#include<cstdio>
using namespace std;
int main()
{
	int m, n;
	int ans = 0, cnt = 0; double a = 0;
	while (scanf("%d,%d", &m, &n) != EOF)
	{
		ans += m*n;
		a += n;
		cnt++;
	}
	a = a / cnt + 0.5;
	printf("%d\n%d\n", ans, (int)a);

Compiler output:
a.cc: In function 'int main()':
a.cc:14:41: error: expected '}' at end of input
   14 |         printf("%d\n%d\n", ans, (int)a);
      |                                         ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){

int x = 0, y = 0, s = 0, sy = 0, a = 0, i = 0;

while(cin >> x >> y){
s = s + x * y;
sy = sy + y;
a = sy / i++;
a+=0.5;
a=int(a)
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: expected ';' before '}' token
   13 | a=int(a)
      |         ^
      |         ;
   14 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int main(void) {
	char c;
	int a, b, sum, ave, i;
	sum = ave = i = 0;
	while (cin >> a >> c >> b) {
		sum += a*b;
		ave += b;
		i++
	}
	cout << sum << endl;
	cout << (int)(((double)ave / i) + 0.5) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before '}' token
   11 |                 i++
      |                    ^
      |                    ;
   12 |         }
      |         ~
Language: C++

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

int main()
{
  int a, b, sum = 0, i = 0, c = 0;
  while (scanf("%d,%d", &a, &b) != EOF){
    sum += a * b;
    i++;
    c += b;
  }
  cout << sum << endl << round(c / i) << endl;
  return (0);
}

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

#include <iostream>
#include <cstdio>
using namespace std;
int main(void){
    // Here your code !
int n,d,sum=0,D=0,cout=0;
char c;


while(cin>>n>>c>>d){
sum+=(n*d);
D=D+d;
cout++;
}

D=(double)D/cout+0.5;
 cout << sum << "\n" << D << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   17 |  cout << sum << "\n" << D << endl;
      |  ~~~~~~~~~~~ ^~ ~~~~
      |       |         |
      |       int       const char [2]
Language: C++

//#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 101
#define MIN -100001
#define ABC 26

int main(void)
{
	double ave;
	int  sum = 0, sum2 = 0, cou = 0, a, b;
	while (scanf_s("%d,%d", &a, &b) != EOF) {
		if (a == b && a == 0) break;
		sum += a * b; sum2 += b;
		++cou;
	}
	ave = (double)sum2 / cou;
	printf("%d %.0f\n", sum,ave);
}

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

//#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 101
#define MIN -100001
#define ABC 26

int main(void)
{
	double ave;
	int  sum = 0, sum2 = 0, cou = 0, a, b;
	while (1) {
		if (scanf_s("%d,%d", &a, &b) == EOF) {
			ave = (double)sum2 / cou;
			printf("%d\n%.0f", sum, ave);
			break;
		}
		sum += a * b; sum2 += b;
		++cou;
	}
}

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

#include<iostream>
#include<cmath>
using namespace std;
int main(){[
	int price, mount;
	char c;
	int sum_price, sum_mount ,cnt;
	while(cin >> price >> c >> mount){
		sum_price += price * mount;
		sum_mount += mount;
		cnt++;
	}
	double average = round( sum_mount / cnt );
	cout << sum_price << '?\n' << average << '?\n';
}

Compiler output:
a.cc:14:30: warning: multi-character character constant [-Wmultichar]
   14 |         cout << sum_price << '?\n' << average << '?\n';
      |                              ^~~~~
a.cc:14:50: warning: multi-character character constant [-Wmultichar]
   14 |         cout << sum_price << '?\n' << average << '?\n';
      |                                                  ^~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: expected identifier before 'int'
    5 |         int price, mount;
      |         ^~~
a.cc:5:18: error: expected ']' before ',' token
    5 |         int price, mount;
      |                  ^
      |                  ]
a.cc: In lambda function:
a.cc:5:18: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:5:20: error: 'mount' was not declared in this scope
    5 |         int price, mount;
      |                    ^~~~~
a.cc:8:22: error: 'price' was not declared in this scope
    8 |         while(cin >> price >> c >> mount){
      |                      ^~~~~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int price, mount;
	char c;
	int sum_price, sum_mount ,cnt;
	while(cin >> price >> c >> mount){
		sum_price += price * mount;
		sum_mount += mount;
		cnt++;
	}
	int average = sum_mount / cnt;
	cout << sum_price << endl
	cout << average << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:34: error: expected ';' before 'cout'
   14 |         cout << sum_price << endl
      |                                  ^
      |                                  ;
   15 |         cout << average << endl;
      |         ~~~~
Language: C++

#include <stdio.h>

int main(void){
int sum=0;
double mean=0;
int x,y;
int i=0;
while(scanf("%d,%d",&x,&y)!=EOF){
sum+=x*y;
mean+=y;
i++;
}
printf("%d\n%d\n",sum,(int)(mean/(double)(i)+0.5));

Compiler output:
a.cc: In function 'int main()':
a.cc:13:52: error: expected '}' at end of input
   13 | printf("%d\n%d\n",sum,(int)(mean/(double)(i)+0.5));
      |                                                    ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

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

int main() {
	int price, num,total_price=0,total_num=0,avarage,i=0;
	while (scanf("%d,%d", &price, &num)!=EOF) {
		total_price = total_price + price*num;
		total_num = total_num + num;
		i++;
	}
	avarage = round(total_num / i);
	cout << total_price << endl << avarage ;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'round' was not declared in this scope
   12 |         avarage = round(total_num / i);
      |                   ^~~~~
Language: C++

import sys
s=[list(map(int,e.split(',')))for e in sys.stdin]
print(sum(a*n for a,n in s))
print(int([sum(x)for x in zip(*s)][1]/len(s)+.5))


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main()
{
	double p, q;
	double price = 0, quantity = 0, amount = 0;

	while (scanf_s("%lf,%lf", &p, &q) != EOF) {
		price += (p * q);
		quantity += q;
		amount++;
	}

	cout << (int)price << endl;
	cout << (int)(quantity / amount + 0.5) << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         while (scanf_s("%lf,%lf", &p, &q) != EOF) {
      |                ^~~~~~~
      |                scanf
Language: C++

long p,c,t,z,n;main(){for(;~scanf("%ld,%dl\n",&p,&c);t+=p*c,z+=c,n++);printf("%ld\n%ld\n",t,lround(1.0*z/n));}

Compiler output:
a.cc:1:16: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | long p,c,t,z,n;main(){for(;~scanf("%ld,%dl\n",&p,&c);t+=p*c,z+=c,n++);printf("%ld\n%ld\n",t,lround(1.0*z/n));}
      |                ^~~~
a.cc: In function 'int main()':
a.cc:1:29: error: 'scanf' was not declared in this scope
    1 | long p,c,t,z,n;main(){for(;~scanf("%ld,%dl\n",&p,&c);t+=p*c,z+=c,n++);printf("%ld\n%ld\n",t,lround(1.0*z/n));}
      |                             ^~~~~
a.cc:1:93: error: 'lround' was not declared in this scope
    1 | long p,c,t,z,n;main(){for(;~scanf("%ld,%dl\n",&p,&c);t+=p*c,z+=c,n++);printf("%ld\n%ld\n",t,lround(1.0*z/n));}
      |                                                                                             ^~~~~~
a.cc:1:71: error: 'printf' was not declared in this scope
    1 | long p,c,t,z,n;main(){for(;~scanf("%ld,%dl\n",&p,&c);t+=p*c,z+=c,n++);printf("%ld\n%ld\n",t,lround(1.0*z/n));}
      |                                                                       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | long p,c,t,z,n;main(){for(;~scanf("%ld,%dl\n",&p,&c);t+=p*c,z+=c,n++);printf("%ld\n%ld\n",t,lround(1.0*z/n));}
Language: C++

#include <cstdio>
using namespace std;
int main() {
	int amt=0,qut=0,cnt=0,a,b;
	while (scanf("%d,%d",&a,&b)!=EOF) {
		amt += a*b;
		qut += b;
		cnt++;
	}
	int res = qut/cnt;
	double dec = qut/cnt-n;
	if (dec/0.1>=5) res++;
	printf("%d\n%d\n",amt,res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: 'n' was not declared in this scope
   11 |         double dec = qut/cnt-n;
      |                              ^
Language: C++

int i,n,m,t,v;
int main(){
	for(;~scanf("%d,%d",&n,&m);i++)
		t+=n*m,v+=m;
	printf("%d\n%d\n",t,(int)(v/(double)i+0.5));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:15: error: 'scanf' was not declared in this scope
    3 |         for(;~scanf("%d,%d",&n,&m);i++)
      |               ^~~~~
a.cc:5:9: error: 'printf' was not declared in this scope
    5 |         printf("%d\n%d\n",t,(int)(v/(double)i+0.5));
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int i,n,m,t,v;
Language: C++

#include <cstdio>

int main(){
    int m, n;
    int total = 0, num = 0, row = 0;
    while( scanf("%d,%d\n", &m, &n) != EOF ){
        total += m * n; //ÌàzÌvÉÁZ
        num += n;       //ÌÌÊÌÉÁZ
        row++;          //üÍÌsðâ·
    }
    int ans = (int)(ave / (double)row + 0.5); //ÌÊÌ½Ï(lÌÜü·é)
    printf("%d\n%d\n", total, ans );
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'ave' was not declared in this scope
   11 |     int ans = (int)(ave / (double)row + 0.5); //ÌÊÌ½Ï(lÌÜü·é)
      |                     ^~~
Language: C++

#include<cstdio>
  2 using namespace std;
  3 
  4 int main(){
  5     int a,b;
  6     int total=0,num=0,row=0;
  7     
  8     while(scanf("%d,%d",&a,&b)!=EOF){
  9         total=total+a*b;
 10         num=num+a;
 11         row++;
 12     }   
 13     int ans=(int)(num/(double)row+0.5);
 14     printf("%d\n%d\n",total,ans);
 15     return 0;
 16 }   

Compiler output:
a.cc:2:3: error: expected unqualified-id before numeric constant
    2 |   2 using namespace std;
      |   ^
a.cc:3:3: error: expected unqualified-id before numeric constant
    3 |   3
      |   ^
Language: C++

#include <string>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <utility>
#include <algorithm>
#include <numeric>
#include <iostream>

using namespace std;
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

int main()
{
	int a,b,c = 0,d = 0,n = 0;
	while(scanf("%d,%d",&a,&b)) c+=a*b, d+=b,n++;
	printf("%d\n%d\n",c,(int)floor((double)d/n + 0.5));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: 'floor' was not declared in this scope
   19 |         printf("%d\n%d\n",c,(int)floor((double)d/n + 0.5));
      |                                  ^~~~~
Language: C++

#include <iostream>
using namespace std;

/** Problem0045 : Sum and Average **/
int main()
{
	unsigned inputNum=0, soldNum=0, value=0;
	unsigned tValue=0, tNum=0, out;
	char camma;
	
	while (cin >> tValue >> camma >> tNum) {
		inputNum++;
		soldNum += tNum;
		value += tValue*tNum;
	}
	
	out = (round)((double)soldNum/inputNum);
	
	cout << value << endl;
	cout << out << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'round' was not declared in this scope
   17 |         out = (round)((double)soldNum/inputNum);
      |                ^~~~~
Language: C++


int main() {
	int x,y;
	int sum,i;
	int tmp;
	char c;
	sum=i=0;
	tmp=0;
	
	while(cin>>x>>c>>y){
		sum+=x*y;
		tmp+=y;
		i++;
	}
	
	cout<<sum<<endl;
	cout<<(int)(1.0*tmp/i+0.5)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'cin' was not declared in this scope
   10 |         while(cin>>x>>c>>y){
      |               ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<sum<<endl;
      |         ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |         cout<<sum<<endl;
      |                    ^~~~
Language: Java

package test;

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

public class AOJ0046 {

	public static void main(String[] args) throws IOException {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		double now_read,max=Integer.MIN_VALUE,min=Integer.MAX_VALUE;
		String line = "";
		while(true){
			line = read.readLine();
			if(line.equals(null)){
				break;
			}
			try{
				now_read = Double.valueOf(line);
			}
			catch(Exception e){
				break;
			}
			max = (max<now_read)?now_read:max;
			min = (min>now_read)?now_read:min;
		}
		System.out.println(max-min);
	}
}

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

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

public class Main {

	public static void main(String[] args){
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		double now_read,max=Integer.MIN_VALUE,min=Integer.MAX_VALUE;
		String line = "";
		while(true){
			line = read.readLine();
			if(line.equals(null)){
				break;
			}
			try{
				now_read = Double.valueOf(line);
			}
			catch(Exception e){
				break;
			}
			max = (max<now_read)?now_read:max;
			min = (min>now_read)?now_read:min;
		}
		System.out.println(max-min);
	}
}

Compiler output:
Main.java:12: error: unreported exception IOException; must be caught or declared to be thrown
			line = read.readLine();
			                    ^
1 error
Language: Java

package aoj;

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

public class main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;

		ArrayList<Double> al = new ArrayList();
		try {
			tes = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		double a = Double.parseDouble(tes);
		al.add(a);
		
		while(true){
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			
			try{
				a = Double.parseDouble(tes);
			}catch(NumberFormatException e){
				break;
			}
			
			
			al.add(a);
		}
		
		for(int i=0;i<al.size();i++){
			for(int j=i+1;j<al.size();j++){
				if(al.get(i) < al.get(j)){
					double tmp = al.get(i);
					al.set(i, al.get(j));
					al.set(j, tmp);
				}
			}
		}
		System.out.println(al.get(0) - al.get(al.size() - 1));
		
		
	}

}

Compiler output:
Main.java:8: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

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

public class main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;

		ArrayList<Double> al = new ArrayList();
		try {
			tes = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		double a = Double.parseDouble(tes);
		al.add(a);
		
		while(true){
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			
			try{
				a = Double.parseDouble(tes);
			}catch(NumberFormatException e){
				break;
			}
			
			
			al.add(a);
		}
		
		for(int i=0;i<al.size();i++){
			for(int j=i+1;j<al.size();j++){
				if(al.get(i) < al.get(j)){
					double tmp = al.get(i);
					al.set(i, al.get(j));
					al.set(j, tmp);
				}
			}
		}
		System.out.println(al.get(0) - al.get(al.size() - 1));
		
		
	}

}

Compiler output:
Main.java:6: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

package aoj;

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

public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;

		List<Double> al = new ArrayList();
		try {
			tes = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		double a = Double.parseDouble(tes);
		al.add(a);
		
		while(true){
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			
			try{
				a = Double.parseDouble(tes);
			}catch(NumberFormatException e){
				break;
			}
			
			
			al.add(a);
		}
		
		for(int i=0;i<al.size();i++){
			for(int j=i+1;j<al.size();j++){
				if(al.get(i) < al.get(j)){
					double tmp = al.get(i);
					al.set(i, al.get(j));
					al.set(j, tmp);
				}
			}
		}
		System.out.println(al.get(0) - al.get(al.size() - 1));
		
		
	}

}

Compiler output:
Main.java:13: error: cannot find symbol
		List<Double> al = new ArrayList();
		^
  symbol:   class List
  location: class Main
1 error
Language: Java

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

public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;

		List<Double> al = new ArrayList<Double>();
		try {
			tes = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		double a = Double.parseDouble(tes);
		al.add(a);
		
		while(true){
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			if(tes.equals(null)){
				break;
			}
			
			try{
				a = Double.parseDouble(tes);
			}catch(NumberFormatException e){
				break;
			}
			
			
			al.add(a);
		}
		
		for(int i=0;i<al.size();i++){
			for(int j=i+1;j<al.size();j++){
				if(al.get(i) < al.get(j)){
					double tmp = al.get(i);
					al.set(i, al.get(j));
					al.set(j, tmp);
				}
			}
		}
		System.out.println(al.get(0) - al.get(al.size() - 1));
		
		
	}

}

Compiler output:
Main.java:11: error: cannot find symbol
		List<Double> al = new ArrayList<Double>();
		^
  symbol:   class List
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;

		List<Double> al = new ArrayList<Double>();
		try {
			tes = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		double a = Double.parseDouble(tes);
		al.add(a);

		while(true){
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			/*if(tes.equals(null)){
				break;
			}
			
			try{
				a = Double.parseDouble(tes);
			}catch(NumberFormatException e){
				break;
			}
			
			
			al.add(a);*/
		}
		
		for(int i=0;i<al.size();i++){
			for(int j=i+1;j<al.size();j++){
				if(al.get(i) < al.get(j)){
					double tmp = al.get(i);
					al.set(i, al.get(j));
					al.set(j, tmp);
				}
			}
		}
		System.out.println(al.get(0) - al.get(al.size() - 1));
		
	}

}

Compiler output:
Main.java:44: error: unreachable statement
		for(int i=0;i<al.size();i++){
		^
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="";
double height;
double max=Double.parseDouble(br.readLine);
double min=max;
while((line=br.readLine())!=null){
height=Double.parseDouble(line);
max=Math.max(max,height);
min=Math.min(min,height);
}
System.out.println(max-min);
}
}

Compiler output:
Main.java:8: error: cannot find symbol
double max=Double.parseDouble(br.readLine);
                                ^
  symbol:   variable readLine
  location: variable br of type BufferedReader
1 error
Language: Java

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

public class Main {
  public static void main(String args[] ) throws IOException {
    BufferedReader br;
    br = InputFile.load();
    Float f = Float.parseFloat(br.readLine());
    float high = f, low = f;
    String line;
    while( ( line = br.readLine() ) != null ) {
      f = Float.parseFloat(line);
      if ( f > high ) {
        high = f;
      } else if ( f < low) {
        low = f;
      }
    }
    System.out.println( high - low );
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
    br = InputFile.load();
         ^
  symbol:   variable InputFile
  location: class Main
1 error
Language: Java

import java.util.Scanner;
import java.util.*;
import java.util.ArrayList;


public class Differential {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	List<Double> list = new ArrayList<>();
	while(sc.hasNext()){
		double x = sc.nextDouble();
		list.add(x);
	}
	
		Double max = list.get(0);
		Double min = list.get(0);
		for (int i = 1; i < list.size(); i++){
			Double v = list.get(i);
			if(v > max){
				max = v;
			}
			if(v < min){
				min = v;
			}
		}
		
		System.out.println(max);
		System.out.println(min);
		System.out.println(max-min);
				
	}
	
}

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

public class Main {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	List<Double> list = new ArrayList<>();
	while(sc.hasNext()){
		double x = sc.nextDouble();
		list.add(x);
	}
	
		Double max = list.get(0);
		Double min = list.get(0);
		for (int i = 1; i < list.size(); i++){
			Double v = list.get(i);
			if(v > max){
				max = v;
			}
			if(v < min){
				min = v;
			}
		}
		
		System.out.println(max);
		System.out.println(min);
		System.out.println(max-min);
				
	}
	
}

Compiler output:
Main.java:3: error: cannot find symbol
	Scanner sc = new Scanner(System.in);
	^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
	Scanner sc = new Scanner(System.in);
	                 ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
	List<Double> list = new ArrayList<>();
	^
  symbol:   class List
  location: class Main
Main.java:4: error: cannot find symbol
	List<Double> list = new ArrayList<>();
	                        ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

mport java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		LinkedList<Double> list = new LinkedList<Double>();
		while(s.hasNext()){
			list.add(s.nextDouble());
		}
		Collections.sort(list);
		System.out.println(list.get(list.size()-1)-list.get(0));
	}

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Collections;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.LinkedList;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
Language: Java

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

public class AOJ_0046
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    ArrayList<Float> inputList = new ArrayList<>();

    while (input.ready())
    {
      inputList.add(Float.parseFloat(input.readLine()));
    }
    final float ans = getDiffHight(inputList);
    System.out.println(ans);
  }

  private static float getDiffHight(ArrayList<Float> list)
  {
    float maxHight = Float.MIN_VALUE;
    float minHight = Float.MAX_VALUE;

    for (Float each : list)
    {
      if (each > maxHight)
      {
        maxHight = each;
      }
      else if (each < minHight)
      {
        minHight = each;
      }
    }
    return maxHight - minHight;
  }
}

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

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		double tall,max,min;
		
		tall = max = min = sc.nextDouble();
		
		while(sc.hasNextDouble()){
			tall = sc.nextDouble();
			if(max < tall) max = tall;
			if(min > tall) min = tall;
		}
		
		System.out.println(max - min);
	}

}

Compiler output:
Main.java:8: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
class Main
{
    public static void main(String args[])
    {
	Scanner scan=new Scanner(System.in);
	float high=0,low=0,x,ans;
	int i=0;
	while(scan.hasNext())
	    {		
		x=scan.nextFloat();
		if(i==0)
		    {
			low=x;
		    }
		
		if(high<x)high=low;
		if(low>x)low=x;
		ans=high-low;
		
		i++;
	    }
	System.out.println(ans);
    }
}

Compiler output:
Main.java:23: error: variable ans might not have been initialized
	System.out.println(ans);
	                   ^
1 error
Language: Java

public class Differential {
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		List<Double> hList = new ArrayList<Double>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		for (int i = 0; i < 5; i++) {
			double h = Double.parseDouble(br.readLine());
			hList.add(h);
		}
		Collections.sort(hList);
		double hMin = (Double) hList.get(0);
		double hMax = (Double) hList.get(hList.size() - 1);
		
		System.out.println(hMax - hMin);
	}
}

Compiler output:
Main.java:1: error: class Differential is public, should be declared in a file named Differential.java
public class Differential {
       ^
Main.java:3: error: cannot find symbol
	public static void main(String[] args) throws NumberFormatException, IOException {
	                                                                     ^
  symbol:   class IOException
  location: class Differential
Main.java:4: error: cannot find symbol
		List<Double> hList = new ArrayList<Double>();
		^
  symbol:   class List
  location: class Differential
Main.java:4: error: cannot find symbol
		List<Double> hList = new ArrayList<Double>();
		                         ^
  symbol:   class ArrayList
  location: class Differential
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Differential
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Differential
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Differential
Main.java:10: error: cannot find symbol
		Collections.sort(hList);
		^
  symbol:   variable Collections
  location: class Differential
8 errors
Language: Java

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

public class Main {
    private static double x;
    private static double max;
    private static double min;
    private static String val;
    
    public static void main(String args[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while((val = br.readLine()) != null){
        	x = Double.parseDouble(val);
        	if(i==0){
            	max=x;
            	min=x;
            }
            else{
            	if(x > max){
            		max=x;
            	}
            	if(x < min){
            		min=x;
            	}
            }
        }
        System.out.println(max-min);
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
        	if(i==0){
        	   ^
  symbol:   variable i
  location: class Main
1 error
Language: C

#include <stdio.h>

int main(void)
{	
	double high,max,min,d;
	
	scanf("%f",&high);
	max = high;
	min = high;
		while(scanf("%f",&high) != EOF){{
		if(max<high){
			max = high;
		}else if(min>high){
			min = high;
		}
	}
	d = max - min;
	
	printf("%.1f",d);
return 0;
}

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

#define _USE_MATH_DEFINES
#include<stdio.h>
int main() {
	double max, min,d;
	scanf_s("%lf", &d);
	max = min = d;
	while (~scanf_s("%lf", &d)) {
		if (d > max)max = d;
		else if (d < min) min = d;
	}
	printf_s("%lf\n", max - min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%lf", &d);
      |         ^~~~~~~
      |         scanf
main.c:11:9: error: implicit declaration of function 'printf_s'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 |         printf_s("%lf\n", max - min);
      |         ^~~~~~~~
      |         printf
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
int main() {
	double max, min,d;
	scanf("%lf", &d);
	max = min = d;
	while (~scanf_s("%lf", &d)) {
		if (d > max)max = d;
		else if (d < min) min = d;
	}
	printf("%lf\n", max - min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         while (~scanf_s("%lf", &d)) {
      |                 ^~~~~~~
      |                 scanf
Language: C

#include <stdio.h>

int main(void)
{
	double max;
	double min;
	double height;
	min=0;
	max=0
	int i;
	for(i=0;i>=50;i++){
		if(height>max)max=height;
		if(height>min)min=height;
	}
	printf("%.1f\n",max-min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:14: error: expected ';' before 'int'
    9 |         max=0
      |              ^
      |              ;
   10 |         int i;
      |         ~~~   
main.c:11:13: error: 'i' undeclared (first use in this function)
   11 |         for(i=0;i>=50;i++){
      |             ^
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
   double h[1000], Max, Min;
   int i = 1;
   scanf("%lf", &h[0]);
   Max = Min = h[0];
   while ( scanf(%lf", &h[i] ) != EOF ) {
      if ( h[i] <= Max ) Max = h[i];
      if ( h[i] >= Min ) Min = h[i];
      i++;
   }
   printf("%.1lf", Max - Min);
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: expected expression before '%' token
    7 |    while ( scanf(%lf", &h[i] ) != EOF ) {
      |                  ^
main.c:7:21: warning: missing terminating " character
    7 |    while ( scanf(%lf", &h[i] ) != EOF ) {
      |                     ^
main.c:7:21: error: missing terminating " character
    7 |    while ( scanf(%lf", &h[i] ) != EOF ) {
      |                     ^~~~~~~~~~~~~~~~~~~~~
main.c:10:11: error: expected ')' before '}' token
   10 |       i++;
      |           ^
      |           )
   11 |    }
      |    ~       
main.c:7:10: note: to match this '('
    7 |    while ( scanf(%lf", &h[i] ) != EOF ) {
      |          ^
main.c:11:4: error: expected expression before '}' token
   11 |    }
      |    ^
main.c: At top level:
main.c:12:11: error: expected declaration specifiers or '...' before string constant
   12 |    printf("%.1lf", Max - Min);
      |           ^~~~~~~
main.c:12:20: error: unknown type name 'Max'
   12 |    printf("%.1lf", Max - Min);
      |                    ^~~
main.c:13:4: error: expected identifier or '(' before 'return'
   13 |    return 0;
      |    ^~~~~~
main.c:14:1: error: expected identifier or '(' before '}' token
   14 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{

	int i,j;
	double max=0,min=0,a[50];
	for(i=0;i<n;i++) scanf("%lf",&a[i]);
	for(i=0;i<n;i++)
		if(max<a[i])
			min=max=a[i];
	for(i=0;i<n;i++)
		if(min>a[i])
			min=a[i];
	printf("%.1f",max-min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:19: error: 'n' undeclared (first use in this function)
    8 |         for(i=0;i<n;i++) scanf("%lf",&a[i]);
      |                   ^
main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
main(){
  double a,max=0,min=10000;
  while(scanf("%lf",&a) !=EOF){
    if(max<a) max=a;
    else if(min>a) min=a
  }
  printf("%g",max-min);
  return 0; 
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:6:25: error: expected ';' before '}' token
    6 |     else if(min>a) min=a
      |                         ^
      |                         ;
    7 |   }
      |   ~
Language: C

#include<stdio.h>

int main(void){
  double a;
  double max;
  double min;

  max = 0.0;
  min = DBL_MAX;
  while(scanf("%lf ",&a)!=EOF){
    if(max < a)max = a;
    if(min > a)min = a;
  }

  printf("%.1lf\n",max - min);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'DBL_MAX' undeclared (first use in this function)
    9 |   min = DBL_MAX;
      |         ^~~~~~~
main.c:2:1: note: 'DBL_MAX' is defined in header '<float.h>'; this is probably fixable by adding '#include <float.h>'
    1 | #include<stdio.h>
  +++ |+#include <float.h>
    2 | 
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
    9 |   min = DBL_MAX;
      |         ^~~~~~~
Language: C

#include <stdio.h>

int main(int argc,char* argv[]){
  double tmp;
  double max=-1.0,min = 999999999.0;

  while(scanf("%lf",&tmp) != EOF){

    if(tmp > max){
      max = tmp;
    }

    if(tmp < min){
      min = tmp;
    }
    
  }

  printf("%.1lf\n",max-min);
  
}
  printf("%.1lf\n",max-min);
  
}

Compiler output:
main.c:22:10: error: expected declaration specifiers or '...' before string constant
   22 |   printf("%.1lf\n",max-min);
      |          ^~~~~~~~~
main.c:22:20: error: unknown type name 'max'
   22 |   printf("%.1lf\n",max-min);
      |                    ^~~
main.c:24:1: error: expected identifier or '(' before '}' token
   24 | }
      | ^