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

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

int main(void)
{	
	while (1) {
		int n;
		cin >> n;		
		if (n == 0) break;
		
		int s[1000];
		for (int i = 0; i < n; i++) cin >> s[i];
		
		double m = 0;
		for (int i = 0; i < n; i++) {
			m += s[i];
		}
		m /= n;
		
		double aan = 0;
		for (int i = 0; i < n; i++) {
			aan += pow((s[i] - m), 2);
		}
		
		a = sqrt(aan / n);
		
		cout << fixed << a << endl;
	}
		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'a' was not declared in this scope
   27 |                 a = sqrt(aan / n);
      |                 ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
main(){
int n,a[1000];
while(1){
cin >>n;
if(n==0) break;
for(i=0;i<n;i++) cin >>a[i];
int sum=0;
for(i=0;i<n;i++) sum=sum+a[i];
double m=1.0*sum/n;
double dist=0.0;
for(i=0;i<n;i++) dist=dist+(m-a[i])*(m-a[i]);
printf("%lf\n",sqrt(dist/n));
return 0;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<n;i++) cin >>a[i];
      |     ^
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<n;i++) sum=sum+a[i];
      |     ^
a.cc:15:5: error: 'i' was not declared in this scope
   15 | for(i=0;i<n;i++) dist=dist+(m-a[i])*(m-a[i]);
      |     ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:7: note: to match this '{'
    5 | main(){
      |       ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
main(){
int n,a[1000];
while(1){
cin >>n;
if(n==0) break;
for(int i=0;i<n;i++) cin >>a[i];
int sum=0;
for(int i=0;i<n;i++) sum=sum+a[i];
double m=1.0*sum/n;
double dist=0.0;
for(int i=0;i<n;i++) dist=dist+(m-a[i])*(m-a[i]);
printf("%lf\n",sqrt(dist/n));
return 0;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:7: note: to match this '{'
    5 | main(){
      |       ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
main(){
int n,a[1000];
while(1){
cin >>n;
if(n==0) break;
for(int i=0;i<n;i++) cin >>a[i];
int sum=0;
for(int i=0;i<n;i++) sum=sum+a[i];
double m=1.0*sum/n;
double dist=0.0;
for(int i=0;i<n;i++) dist=dist+(m-a[i])*(m-a[i]);
}
printf("%lf\n",sqrt(dist/n));
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:17:21: error: 'dist' was not declared in this scope
   17 | printf("%lf\n",sqrt(dist/n));
      |                     ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
  double i,n;
  double sum = 0;
  double a,average;
  while(1){
    sum = 0;
    double s[1001]={};
    average = 0;
    cin>>n;
    if(n == 0){break;}
  for(i = 0;i < n;i++){
    cin>>s[i];
    sum += s[i];
  }
  average = sum/n;
  sum = 0;
  for(i = 0;i < n;i++){
    sum += pow((s[i]-average),2.0);
  }
  a = sqrt(sum/n);
  cout<<fixed<<setprecision(4)<<a<<endl;
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: invalid types 'double [1001][double]' for array subscript
   16 |     cin>>s[i];
      |           ^
a.cc:17:13: error: invalid types 'double [1001][double]' for array subscript
   17 |     sum += s[i];
      |             ^
a.cc:22:18: error: invalid types 'double [1001][double]' for array subscript
   22 |     sum += pow((s[i]-average),2.0);
      |                  ^
Language: C++

#include <iostream>
#include <math.h>
#include <cstdio>
using namespace std;

int main(){
	int i,j,n,x,total=0;
	double ave=0.0f,sd=0.0f,m=0.0f;
	while(1){
		cin >> n;
		if(n==0)break;
	int s[n];
	for(i=0;i<n;i++){
	cin >> s[i];
	total += s[i];
	}
	for(i=0;i<n;i++){
		sd += pow((s[i]-total:1.0/n),2.0);
	}
	m=sqrt(sd/n);
	printf("%lf\n",m);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:38: error: expected ')' before ':' token
   18 |                 sd += pow((s[i]-total:1.0/n),2.0);
      |                           ~          ^
      |                                      )
a.cc:18:50: error: expected ')' before ';' token
   18 |                 sd += pow((s[i]-total:1.0/n),2.0);
      |                          ~                       ^
      |                                                  )
Language: C++

#include <iostream>
#include <math.h>
#include <cstdio>
using namespace std;

int main(){
	int n;
	double total,sd,s[1001];
	while(1){
		total=0;
		sd=0;
		cin >> n;
		if(n==0){
			break;
		}
	for(i=0;i<n;i++){
	cin >> s[i];
	total += s[i];
	}
		total=total/n;
	for(i=0;i<n;i++){
		sd += pow((s[i]-total),2);
	}
	printf("%.8f\n",sqrt(sd/n));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'i' was not declared in this scope
   16 |         for(i=0;i<n;i++){
      |             ^
a.cc:21:13: error: 'i' was not declared in this scope
   21 |         for(i=0;i<n;i++){
      |             ^
Language: C++

#include <iostream>
using namespace std;

int main(void) {

	while (1) {
		int n;
		double ave = 0;
		double var = 0;
		cin >> n;
		int *m = new int[n];

		if (n == 0) break;

		for (int i = 0; i < n; i++) {
			cin >> m[i];
			ave += m[i] / n;
		}
		cout << ave << endl;
		for (int i = 0; i < n; i++) {
			var += pow(m[i] - ave, 2) / n;
		}
		var = sqrt(var);
		cout << var << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: 'pow' was not declared in this scope
   21 |                         var += pow(m[i] - ave, 2) / n;
      |                                ^~~
a.cc:23:23: error: 'sqrt' was not declared in this scope
   23 |                 var = sqrt(var);
      |                       ^~~~
Language: C++

#include <iostream>
#include <math.h>

using nameaspace std;

int main(void) {

	while (1) {
		int n;
		double ave = 0;
		double var = 0;
		cin >> n;
		int *m = new int[n];

		if (n == 0) break;

		for (int i = 0; i < n; i++) {
			cin >> m[i];
			ave += m[i];
		}
		ave /= n;
		for (int i = 0; i < n; i++) {
			var += pow(m[i] - ave, 2) / n;
		}
		var = sqrt(var);
		cout << var << endl;

		delete[] m;
	}
	
	return 0;
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'nameaspace'
    4 | using nameaspace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:12:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |                 cin >> n;
      |                 ^~~
      |                 std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:26:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |                 cout << var << endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:26:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |                 cout << var << endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main()
{
	int n = 0;
	//double ave = 0, sum = 0;	
	while (cin >> n,n != 0) {
		int temp[1001];
		double ave = 0, sum = 0;
		memset(temp, 0, sizeof(temp));
		int cnt = n;
		while (cnt) {
			cin >> temp[n - cnt];
			sum += temp[n - cnt];
			cnt--;
		}
		ave = sum / n;
		double db = 0;
		for (int i = 0; i < n; i++) {
			db += pow(temp[i] - ave, 2);
		}
		cout << fixed << sqrt(db / n) << endl;
	}
	return 0;
}

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

#include <math.h>
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n = 0;
	//double ave = 0, sum = 0;	
	while (cin >> n,n != 0) {
		int temp[1001];
		double ave = 0, sum = 0;
		memset(temp, 0, sizeof(temp));
		int cnt = n;
		while (cnt) {
			cin >> temp[n - cnt];
			sum += temp[n - cnt];
			cnt--;
		}
		ave = sum / n;
		double db = 0;
		for (int i = 0; i < n; i++) {
			db += pow(temp[i] - ave, 2);
		}
		cout << fixed << sqrt(db / n) << endl;
	}
	return 0;
}

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

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

int main()
{
	int nCount, nCo;
	while (cin >> nCount, nCount)
	{
		int nInput[1000] = { 0 };
		long float nSum = 0;
		int i = 0;
		int nIn = 0;

		nCo = nCount;
		while (nCount--)
		{
			cin >> nIn;
			nInput[i++] = nIn;
			nSum += nIn;
		}
		float nAvg = nSum / nCo;
		nSum = 0;
		for (int i = 0; i < nCo; i++)
		{
			nSum += (nInput[i] - nAvg)*(nInput[i] - nAvg);
		}
		nSum /= nCo;
		nSum = sqrtf(nSum);
		printf("%.5f\n", nSum);
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'long' specified with 'float'
   11 |                 long float nSum = 0;
      |                 ^~~~
Language: C++

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

int main()
{
	int nCount, nCo;
	while (cin >> nCount, nCount)
	{
		int nInput[1000] = { 0 };
		long float nSum = 0;
		int i = 0;
		int nIn = 0;

		nCo = nCount;
		while (nCount--)
		{
			cin >> nIn;
			nInput[i++] = nIn;
			nSum += nIn;
		}
		float nAvg = nSum / nCo;
		nSum = 0;
		for (int i = 0; i < nCo; i++)
		{
			nSum += (nInput[i] - nAvg)*(nInput[i] - nAvg);
		}
		nSum /= nCo;
		nSum = sqrtf(nSum);
		printf("%.5f\n", nSum);
	}
	//system("pause");
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'long' specified with 'float'
   11 |                 long float nSum = 0;
      |                 ^~~~
Language: C++

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

int main()
{
	int nCount, nCo;
	while (cin >> nCount, nCount)
	{
		int nInput[1000] = { 0 };
		long float nSum = 0;
		int i = 0;
		int nIn = 0;

		nCo = nCount;
		while (nCount--)
		{
			cin >> nIn;
			nInput[i++] = nIn;
			nSum += nIn;
		}
		float nAvg = nSum / nCo;
		nSum = 0;
		for (int i = 0; i < nCo; i++)
		{
			nSum += (nInput[i] - nAvg)*(nInput[i] - nAvg);
		}
		nSum /= nCo;
		nSum = sqrtf(nSum);
		printf("%.5f\n", nSum);
	}
	//system("pause");
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'long' specified with 'float'
   11 |                 long float nSum = 0;
      |                 ^~~~
Language: C++

#include <iostream>
#include <stdio>
#include <string>

int main() {
  int n;

  while(std::getline(std::cin, n)) {
    if(n == 0) break;
    int *score = new int[n];
    int sum = 0;
    for(int i = 0; i < n; ++i) {
      std::cin >> score[i];
      sum += score[i];
    }
    double average = sum / n;
    double alpha = 0;
    for(int i = 0; i < n; ++i) {
      alpha += (score[i] - average) +(score[i] - average);
    }
    alpha /= n;
    printf("%.4f\n", alpha);
    delete[] score;
  }

  return 0;
}

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

#include <iostream>
#include <sctdio>
#include <string>

int main() {
  int n;

  while(std::getline(std::cin, n)) {
    if(n == 0) break;
    int *score = new int[n];
    int sum = 0;
    for(int i = 0; i < n; ++i) {
      std::cin >> score[i];
      sum += score[i];
    }
    double average = sum / n;
    double alpha = 0;
    for(int i = 0; i < n; ++i) {
      alpha += (score[i] - average) +(score[i] - average);
    }
    alpha /= n;
    printf("%.4f\n", alpha);
    delete[] score;
  }

  return 0;
}

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

import java.io.InputStreamReader;
import java.io.LineNumberReader;

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

		try {
			LineNumberReader lineNumReader = new LineNumberReader(new InputStreamReader(System.in));
			String str = null;
			double  scores[] = null;
			int studentsNum = 0;

			while ((str = lineNumReader.readLine()) != null) {
				if (lineNumReader.getLineNumber()%2 == 1) {
					studentsNum = Integer.parseInt(str);
				}
				if (studentsNum == 0) {
					break;
				}
				if (lineNumReader.getLineNumber() % 2 == 0) {
					String[] points = str.split(" ");
					scores = new double[studentsNum];
					int i = 0;

					for (String point : points) {
						scores[i] = Long.parseLong(point);
						i++;
					}

					double sum = 0;

					for (double score : scores) {
						sum += score;
					}
					double mean = sum / studentsNum;
					double sig2 = 0;

					for (double score : scores) {
						sig2 += Math.pow(score - mean, 2);
					}

					//Σ
					double sigma = Math.sqrt(sig2 / studentsNum);
					System.out.println(String.format("%.8f", sigma));
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
}


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

#include <iostream>
#include <complex>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;

int main(void)
{
    int n;
    double a[1000];
    while (cin >> n && n != 0) {
        for (int i = 0; i < n; ++i)
            cin >> a[i];
        double ave = std::accumulate(a, a + n, 0.0) / n;
        double dev = 0.0;
        for (int i = 0; i < n; ++i)
            dev += pow(a[i] - ave, 2.0);
        dev /= n;
        cout << fixed << setprecision(10) << sqrt(dev) << endl;
    }
    return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: 'accumulate' is not a member of 'std'
   15 |         double ave = std::accumulate(a, a + n, 0.0) / n;
      |                           ^~~~~~~~~~
Language: C++

import java.util.*;
class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        while(true) {
            int n = stdIn.nextInt();
            if(n == 0) break;
            int[] s = new int[n];
            int sum = 0;
            for(int i = 0; i < n; i++) {
                s[i] = stdIn.nextInt();
                sum += s[i];
            }
            double m = sum/(double)n;
            double a = 0.0;
            for(int i = 0; i < n; i++) {
                a += (s[i] - m)*(s[i] - m);
            }
            a= a/(double)n;
             
            System.out.println(Math.sqrt(a));
             
        }
    }
}


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:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args) {
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args) {
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args) {
      |                                      ^~~~
a.cc:26:2: error: expected ';' after class definition
   26 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
    5 |         Scanner stdIn = new Scanner(System.in);
      |         ^~~~~~~
a.cc:7:21: error: 'stdIn' was not declared in this scope; did you mean 'std'?
    7 |             int n = stdIn.nextInt();
      |                     ^~~~~
      |                     std
a.cc:9:16: error: structured binding declaration cannot have type 'int'
    9 |             int[] s = new int[n];
      |                ^~
a.cc:9:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:9:16: error: empty structured binding declaration
a.cc:9:19: error: expected initializer before 's'
    9 |             int[] s = new int[n];
      |                   ^
a.cc:12:17: error: 's' was not declared in this scope
   12 |                 s[i] = stdIn.nextInt();
      |                 ^
a.cc:18:23: error: 's' was not declared in this scope
   18 |                 a += (s[i] - m)*(s[i] - m);
      |                       ^
a.cc:22:13: error: 'System' was not declared in this scope
   22 |             System.out.println(Math.sqrt(a));
      |             ^~~~~~
a.cc:22:32: error: 'Math' was not declared in this scope
   22 |             System.out.println(Math.sqrt(a));
      |                                ^~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
#include<map>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 100000000
#define MOD 100000007
#define SIZE 100005
#define PI 	3.14159265358979323846


int main(){
    while(1){
        ll n;
        cin >> n;
        if(n==0) return 0;
        ld s[1000],sum=0;
        REP(i,n){
            cin >> s[i];
            sum += s[i];
        }
        //ld m = sum / n;
        //printf("%.8llf\n",sum);
        //printf("%.8llf\n",m);
        sum = 0;
        REP(i,n){
            sum += (ld)pow(s[i]-m,2);
        }
        ld ans = sum/n;
        //printf("%.8llf\n",ans);
        ans = (ld)sqrt(ans);
        printf("%.8llf\n",ans);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:33: error: 'm' was not declared in this scope
   44 |             sum += (ld)pow(s[i]-m,2);
      |                                 ^
Language: C++

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int isum=0;
        double dsum;
        double ave;
        double s;
        double tmp=0;
        int num = sc.nextInt();
        if(num==0) System.exit(0);
        int[] score=new int[num];
        for (int i = 0; i < num; i++) {
            score[i]=sc.nextInt();
            isum+=score[i];
        }
        dsum=isum;
        ave=dsum/num;
        for(int i=0;i<num;i++){
            tmp+=Math.pow(score[i]-ave,2.0);
        }
        s=Math.sqrt(tmp/num);
        System.out.println(s);
    }
}



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

import java.util.Scanner;

public class Main{
public static void main(String[] args){
    try (Scanner sc = new Scanner(System.in)){
        double average = 0, variance = 0,total = 0,total2 = 0;
        while(true){
            int n = sc.nextInt();
            if(n == 0) {
                break;
            }
            int[] scores = new int[n];
            for(int i =0;i < scores.length;i++){
                scores[i] = sc.nextInt();
                total += scores[i];
            }
            average = total / n;
            for(int i = 0; i < scores.length;i++) {
                total2 += (scores[i] - average) * (scores[i] - average);
                variance = total2 / scores.length;
            }
            System.out.println(Math.sqrt(variance));
        }
    }
}
}


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

# include <stdint.h>
# include <stdio.h>
# include <math.h>
# include <algorithm>
# include <string>
using namespace std;


int main(){
    int sum =0 ,x =0;
    double a,avg;
    int n;
    double b[n];
	while((cin >>n) != 0){
        if(n ==0) break;
        else{
            for(int i =0;i<n;i++){
                cin >>b[i];
                sum += b[i];
            }
            avg = (double)sum /(double)n;
            for(int j=0;j<n;j++){
               x += pow(b[j]-avg,2);
            }
            a= (double)x/(double)n;
             printf("%.7f\n",pow(a,0.5));
        }


    }

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'cin' was not declared in this scope
   14 |         while((cin >>n) != 0){
      |                ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | # include <string>
  +++ |+#include <iostream>
    6 | using namespace std;
Language: C++

#include <iostream>
#include <valarray> 
using namespace std;
int main()
{   
    int num;
    while(cin>>num)
    {
        if(num==0)
         break;
        double a[num];
        double sum=0,STD=0;
         for(int i=0;i<num;i++)
         {
             cin>>num[i];
             sum+=num
         }
         for(int i=0;i<num;i++){
             STD+=(num[i]-sum/num)*(num[i]-sum/num)/num;
         }
         cout<<setiosflags(ios::fixed)<<setprecision(10)<<STD<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: invalid types 'int[int]' for array subscript
   15 |              cin>>num[i];
      |                      ^
a.cc:16:22: error: expected ';' before '}' token
   16 |              sum+=num
      |                      ^
      |                      ;
   17 |          }
      |          ~            
a.cc:19:23: error: invalid types 'int[int]' for array subscript
   19 |              STD+=(num[i]-sum/num)*(num[i]-sum/num)/num;
      |                       ^
a.cc:19:40: error: invalid types 'int[int]' for array subscript
   19 |              STD+=(num[i]-sum/num)*(num[i]-sum/num)/num;
      |                                        ^
a.cc:21:16: error: 'setiosflags' was not declared in this scope
   21 |          cout<<setiosflags(ios::fixed)<<setprecision(10)<<STD<<endl;
      |                ^~~~~~~~~~~
a.cc:3:1: note: 'std::setiosflags' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    2 | #include <valarray>
  +++ |+#include <iomanip>
    3 | using namespace std;
a.cc:21:41: error: 'setprecision' was not declared in this scope
   21 |          cout<<setiosflags(ios::fixed)<<setprecision(10)<<STD<<endl;
      |                                         ^~~~~~~~~~~~
a.cc:21:41: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
Language: C++

#include <bits/stdc++.h>
#include <valarray> 
using namespace std;
int main()
{   
    int num;
    while(cin>>num)
    {
        if(num==0)
         break;
        double a[num];
        double sum=0,STD=0;
         for(int i=0;i<num;i++)
         {
             cin>>num[i];
             sum+=num
         }
         for(int i=0;i<num;i++){
             STD+=(num[i]-sum/num)*(num[i]-sum/num)/num;
         }
         cout<<setiosflags(ios::fixed)<<setprecision(10)<<STD<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: invalid types 'int[int]' for array subscript
   15 |              cin>>num[i];
      |                      ^
a.cc:16:22: error: expected ';' before '}' token
   16 |              sum+=num
      |                      ^
      |                      ;
   17 |          }
      |          ~            
a.cc:19:23: error: invalid types 'int[int]' for array subscript
   19 |              STD+=(num[i]-sum/num)*(num[i]-sum/num)/num;
      |                       ^
a.cc:19:40: error: invalid types 'int[int]' for array subscript
   19 |              STD+=(num[i]-sum/num)*(num[i]-sum/num)/num;
      |                                        ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
int main(void){
    // Your code here!
    long double a,b,c=0,d,e,f,g=0;
    int A[100];
    while(1){
    cin>>a;
    if(a==0){
    	break;
    }
    cin>>b;
    for(int i=0;i<b;i++){
    	cin>>A[i];
    	c+=A[i];
    }
    for(int=0;i<b;i++){
    	g+=pow(A[i]-c,2);
    }
    g=sqrt(g/b);
    //cout<<printf("%.10lf\n", sqrt(e))<<endl;
    //e=sqrt(e);
    // cout << f << endl;
    std::cout << setprecision(16) << g <<endl;
    c=0;
    g=0;
    A={0};
	}
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: expected unqualified-id before '=' token
   21 |     for(int=0;i<b;i++){
      |            ^
a.cc:21:12: error: expected ';' before '=' token
   21 |     for(int=0;i<b;i++){
      |            ^
      |            ;
a.cc:21:12: error: expected primary-expression before '=' token
a.cc:21:15: error: 'i' was not declared in this scope
   21 |     for(int=0;i<b;i++){
      |               ^
a.cc:21:18: error: expected ')' before ';' token
   21 |     for(int=0;i<b;i++){
      |        ~         ^
      |                  )
a.cc:21:19: error: 'i' was not declared in this scope
   21 |     for(int=0;i<b;i++){
      |                   ^
a.cc:31:6: error: assigning to an array from an initializer list
   31 |     A={0};
      |     ~^~~~
Language: C++

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

main(){
 int n, A[1000];
 while(1){
  c >> n;
  if(n==0)break;
  for(int i=0; i<n; i++) cin >> A[i];
  int sum=0;
 for(int i=0; i<n; i++) sum +=A[i];
 double avg=1.0*sum/n;
 double dist=0.0;
 for(int i=0; i<n; i++){
  dist+=(avg-A[i])*(avg-A[i]);
 }
 printf("%lf\n", sqrt(dist/n));
}
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'c' was not declared in this scope
    9 |   c >> n;
      |   ^
Language: C++

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

main(){
 int n, A[1000];
 while(1){
  c >> n;
  if(n==0)break;
  for(int i=0; i<n; i++) cin >> A[i];
  int sum=0;
 for(int i=0; i<n; i++) sum +=A[i];
 double avg=1.0*sum/n;
 double dist=0.0;
 for(int i=0; i<n; i++){
  dist+=(avg-A[i])*(avg-A[i]);
 }
 printf("%lf\n", sqrt(dist/n));
}
return 0;
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'c' was not declared in this scope
    9 |   c >> n;
      |   ^
Language: C++

#include<iostream>
#include<cmath>
#include<iomanip>
#include<cstdio>
using namespace std;
int main(){

  while(1){
    double n,sum=0,a[1000];
    double av=0,s=0;
    cin>>n;
    if(n==0)break;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  av=sum/n;
  for(int i=0;i<n;i++){
    s+=pow(a[i]-av,2);
  }
  s/=n;
  //printf("%.10f\n",sqrt(s));
  cout<<setprecision(10);sqrt(s)<<endl;
  }
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:33: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<'
   23 |   cout<<setprecision(10);sqrt(s)<<endl;
      |                          ~~~~~~~^~~~~~
Language: C++

#include<iostream>
#include<cmath>
#include<iomanip>
#include<cstdio>
using namespace std;
int main(){

  while(1){
    double n,sum=0,a[1000];
    double av=0,s=0;
    cin>>n;
    if(n==0)break;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  av=sum/n;
  for(int i=0;i<n;i++){
    s+=pow(a[i]-av,2);
  }
  s/=n;
  //printf("%.10f\n",sqrt(s));
  cout<<setprecision(10<<sqrt(s)<<endl;
  }
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: invalid operands of types 'int' and 'double' to binary 'operator<<'
   23 |   cout<<setprecision(10<<sqrt(s)<<endl;
      |                      ~~^~~~~~~~~
      |                      |       |
      |                      int     double
Language: C++

#include<iostream>
#define MAX 1000
using namespace std;

int main()
{
	int n,i=0,j=0;
	int S[MAX]={0};
	double a=0.0,m=0.0,temp=0.0;

	while(1)
	{
		cin >> n;
		
		if(n == 0 ) break;

		for(j=0;j<n;j++)
		{
			cin >> S[i] ;
			m = m + S[i] ;
			i++;
		}

	m = m / n ;

	for(i=0;i<n;i++)
	{
		temp = temp + (S[i] - m)*(S[i] - m) ;
	}

	a = temp / n ;

	a = sqrt(a);

	cout << a << endl;

	a = 0.0;
	m = 0.0;
	temp = 0.0;
	i=0;

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'sqrt' was not declared in this scope
   33 |         a = sqrt(a);
      |             ^~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <vector>
#include <numeric>
using namespace std;

const double eps = 1e-8;

int main() {
    for(int N; cin >> N, N; ) {
        vector<double> S(N);
        for(int i = 0; i < N; i++) cin >> S[i];
        sort(S.begin(), S.end());
        double mean = accumulate(S.begin(), S.end(), 0) / N;
        double var = 0;
        for(int i = 0; i < N; i++) var += (S[i] - mean) * (S[i] - mean);
        var /= N;
        if(var < 0 - eps) var *= -1;
        printf("%.5f\n", sqrt(var));
    }
}

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

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

double istdev(vector <int> &nums){
	int n=nums.size();
	double ave;

	int tmp = 0;
	for (int i=0; i<n; i++)
		tmp += nums[i];
	ave = (double)tmp/n;

	double tmp = 0;
	for (int i=0; i<n; i++)
		tmp += pow(nums[i]-ave,2);
	return sqrt(tmp/n);
}

int main(void)
{
	int n;
	while (cin >> n, n != 0){
		vector <int> s(n);
		for (int i=0; i<n; i++)
			cin >> s[i];

		cout << fixed << istdev(s) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'double istdev(std::vector<int>&)':
a.cc:15:16: error: conflicting declaration 'double tmp'
   15 |         double tmp = 0;
      |                ^~~
a.cc:10:13: note: previous declaration as 'int tmp'
   10 |         int tmp = 0;
      |             ^~~
Language: C++

#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(){

int i;
double n,score[1000],ave=0,sigma=0;
cin>>n;

for(i=0; i<n; i++){
cin>>score[i];
ave+=score[i];
}

ave/=n;

for(i=0; i<n; i++)sigma+=(score[i]-ave)*(score[i]-ave);

printf("%.8f\n",sqrt(sigma/n);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: expected ')' before ';' token
   20 | printf("%.8f\n",sqrt(sigma/n);
      |       ~                      ^
      |                              )
Language: C++

#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(){

int i,n;
double n,score[1000],ave=0,sigma=0;

while(1){

if(n==0)return 0;
cin>>n;

for(i=0; i<n; i++){
cin>>score[i];
ave+=score[i];
}

(double)ave/=n;

for(i=0; i<n; i++)sigma+=(double)(score[i]-ave)*(score[i]-ave);

printf("%.8f\n",sqrt((double)sigma/n));

}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: conflicting declaration 'double n'
    8 | double n,score[1000],ave=0,sigma=0;
      |        ^
a.cc:7:7: note: previous declaration as 'int n'
    7 | int i,n;
      |       ^
a.cc:20:1: error: lvalue required as left operand of assignment
   20 | (double)ave/=n;
      | ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(){

int i,n;
double score[1000],ave=0,sigma=0;

while(1){

if(n==0)return 0;
cin>>n;

for(i=0; i<n; i++){
cin>>score[i];
ave+=score[i];
}

(double)ave/=n;

for(i=0; i<n; i++)sigma+=(double)(score[i]-ave)*(score[i]-ave);

printf("%.8f\n",sqrt((double)sigma/n));

}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:1: error: lvalue required as left operand of assignment
   20 | (double)ave/=n;
      | ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){

int i,n;
double score[1000],ave=0,sigma;

while(1){

ave=sigma=0;
cin>>n;
if(n==0)return 0;

for(i=0; i<n; i++){
cin>>score[i];
ave+=score[i];
}

ave/=(double)n;

for(i=0; i<n; i++)sigrma+=(double)(score[i]-ave)*(score[i]-ave);

printf("%.8f\n",sqrt(sigma/(double)n));

}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'sigrma' was not declared in this scope; did you mean 'sigma'?
   23 | for(i=0; i<n; i++)sigrma+=(double)(score[i]-ave)*(score[i]-ave);
      |                   ^~~~~~
      |                   sigma
Language: Java

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

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

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		int n=Integer.parseInt(str);
		String xstr=br.readLine();
		String ystr=br.readLine();
		String[] x=xstr.split(" ");
		String[] y=ystr.split(" ");
		int p=1;
		int[] t=new int[n];
		double dis=0;
		long ln=0;
		for(int i=0;i<n;i++){
			int l=Integer.parseInt(x[i]);
			int q=Integer.parseInt(y[i]);
		if(l>q)
		t[i]=l-q;
		else
		t[i]=q-l;
		ln+=Math.pow(t[i],p);}

		dis=Math.pow(ln,1/p);



		System.out.printf("%.6f%n",dis);
	
	

Compiler output:
Main.java:34: error: reached end of file while parsing
		System.out.printf("%.6f%n",dis);
		                                ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static Scanner sc;
	public static void main(String[] args){
		sc=new Scanner(System.in);
		int n=sc.nextInt();
		int x[]=new int[n];
		int y[]=new int[n];
		for(int i=0;i<n;i++){
			x[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			y[i]=sc.nextInt();
		}
		Double d1,sum2,sum3,d4;
		for(int i=0,d1=0,sum2=0,sum3=0,d4=0;i<n;i++){
			d1+=Math.abs(x[i]-y[i]);
			sum2+=(x[i]-y[i])*(x[i]-y[i]);
			sum3+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
			d4=Math.max(d4,Math.abs(x[i]-y[i]));
		}
		System.out.println(d1);
		System.out.println(Math.sqrt(sum2));
		System.out.println(Math.cbrt(sum3));
		System.out.println(d4);
	}

}

Compiler output:
Main.java:17: error: variable d1 is already defined in method main(String[])
		for(int i=0,d1=0,sum2=0,sum3=0,d4=0;i<n;i++){
		            ^
Main.java:17: error: variable sum2 is already defined in method main(String[])
		for(int i=0,d1=0,sum2=0,sum3=0,d4=0;i<n;i++){
		                 ^
Main.java:17: error: variable sum3 is already defined in method main(String[])
		for(int i=0,d1=0,sum2=0,sum3=0,d4=0;i<n;i++){
		                        ^
Main.java:17: error: variable d4 is already defined in method main(String[])
		for(int i=0,d1=0,sum2=0,sum3=0,d4=0;i<n;i++){
		                               ^
4 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String[] xs = scan.nextLine().split(" ");
	String[] ys = scan.nextLine().split(" ");
	int[] x = new int[n];
	int[] y = new int[n];
	for (int i = 0; i < n; i++) {
	    x[i] = Integer.parseInt(xs[i]);
	    y[i] = Integer.parseInt(ys[i]);
	}
	System.out.println(manhattanDistance(x, y));
	System.out.println(minkowskiDistance(x, y, 2));
	System.out.println(minkowskiDistance(x, y, 3));
	System.out.println(chebyshevDistance(x, y));
    }
    public static double absoluteValue(int a, int b){
	if (a < b) {
	    return (double)b - a;
	} else {
	    return (double)a - b;
	}
    }
    public static double manhattanDistance(int[] x, int[] y){
	double sum = 0;
	for (int i = 0; i < x.length; i++) {
	    sum += absoluteValue(x[i], y[i]);
	}
	return (double)sum;
    }
    public static double minkowskiDistance(int[] x, int[] y, int p){
	double sum = 0;
	for (int i = 0; i < x.length; i++) {
	    sum += Math.pow(absoluteValue(x[i], y[i]), p);
	}
	if (p == 2) {
	    return Math.sqrt(sum);
	} else if (p == 3) {
	    return Math.cbrt(sum);
	}
	return 0;
    }
    public static double chebyshevDistance(int[] x, int[] y){
	int max = 0;
	for (int i = 0; i < x.length; i++) {
	    int distance = absoluteValue(x[i], y[i]);
	    if (max < distance) {
		max = distance;
	    }
	}
	return (double)max;
    }
}

Compiler output:
Main.java:48: error: incompatible types: possible lossy conversion from double to int
	    int distance = absoluteValue(x[i], y[i]);
	                                ^
1 error
Language: Java

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

public class A11 {

	public static void main(String[] args) {
		double dbD1 = 0.0;
		double dbD2 = 0.0;
		double dbD3 = 0.0;
		double dbMax = 0.0;


		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			String str = br.readLine();
			str = br.readLine();

			String[] arrX = str.split(" ");

			int[][] intArrX = new int[2][arrX.length];

			// 3???????????????
			str = br.readLine();
			String[] arrY = str.split(" ");

			for (int i = 0; i < arrY.length; i++) {

				// ????´?
				intArrX[0][i] = Integer.parseInt(arrX[i]);
				intArrX[1][i] = Integer.parseInt(arrY[i]);

				dbD1 += Math.abs(intArrX[0][i] - intArrX[1][i]);

				dbD2 += Math.abs(intArrX[0][i] - intArrX[1][i])
						* Math.abs(intArrX[0][i] - intArrX[1][i]);

				dbD3 += Math.abs(intArrX[0][i] - intArrX[1][i])
						* Math.abs(intArrX[0][i] - intArrX[1][i])
						* Math.abs(intArrX[0][i] - intArrX[1][i]);

				if (i == 0) {

					dbMax = Math.abs(intArrX[0][i] - intArrX[1][i]);
				} else {


					if (dbMax < Math.abs(intArrX[0][i] - intArrX[1][i])) {
						dbMax = intArrX[0][i] - intArrX[1][i];
					}
				}



			}
			dbD2 = Math.sqrt(dbD2);
			dbD3 = Math.cbrt(dbD3);

			System.out.printf("%5f",dbD1);
			System.out.println();
			System.out.printf("%5f",dbD2);
			System.out.println();
			System.out.printf("%5f",dbD3);
			System.out.println();
			System.out.printf("%5f",dbMax);


		} catch (IOException e) {
			System.out.println(e);
		} catch (NumberFormatException e) {
			System.out.println("??°?????§??\??????????????????");
		}
	}
}

Compiler output:
Main.java:72: error: illegal escape character
			System.out.println("???????????\??????????????????");
			                                ^
1 error
Language: Java

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

public class A11 {

	public static void main(String[] args) {
		double dbD1 = 0.0;
		double dbD2 = 0.0;
		double dbD3 = 0.0;
		double dbMax = 0.0;
		double xy;


		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

//			String str = br.readLine();
//			str = br.readLine();

			int n = Integer.parseInt(br.readLine() );
			int[] x = new int[n];
			int[] y = new int[n];


			String[] arrX = br.readLine().split(" ");
			String[] arrY = br.readLine().split(" ");

			for(int i=0; i<n; i++)
			{
				x[i] = Integer.parseInt(arrX[i]);
				y[i] = Integer.parseInt(arrY[i]);
			}


			//	int[][] intArrX = new int[2][arrX.length];


			//			str = br.readLine();
			//			String[] arrY = str.split(" ");

			//			for(int i=0; i<arrY.length; i++){
			//				intArrX[0][i] = Integer.parseInt(arrX[i]);
			//				//intArrX[1][i] = Integer.parseInt(arrY[i]);
			//				System.out.println(intArrX[0][i]  +" " + intArrX[1][i]);
			//			}

			for (int i = 0; i < n; i++) {
				xy = Math.abs(x[i] - y[i]);

				dbD1 += Math.pow(xy, 1);
				dbD2 += Math.pow(xy, 2);
				dbD3 += Math.pow(xy, 3);

				dbMax = Math.max(xy, dbMax);


//				dbD1 += Math.abs(intArrX[0][i] - intArrX[1][i]);
//
//				dbD2 += Math.abs(intArrX[0][i] - intArrX[1][i])
//						* Math.abs(intArrX[0][i] - intArrX[1][i]);
//
//				dbD3 += Math.abs(intArrX[0][i] - intArrX[1][i])
//						* Math.abs(intArrX[0][i] - intArrX[1][i])
//						* Math.abs(intArrX[0][i] - intArrX[1][i]);

				//if (i == 0) {

					//	dbMax = Math.abs(intArrX[0][i] - intArrX[1][i]);
				//} else {


//				if (dbMax < Math.abs(intArrX[0][i] - intArrX[1][i])) {
//					dbMax = intArrX[0][i] - intArrX[1][i];
//				}
//				//}

			}

			dbD2 = Math.sqrt(dbD2);
			dbD3 = Math.cbrt(dbD3);

			System.out.printf("%.6f",dbD1);
			System.out.println();
			System.out.printf("%.6f",dbD2);
			System.out.println();
			System.out.printf("%.6f",dbD3);
			System.out.println();
			System.out.printf("%.6f",dbMax);



		} catch (IOException e) {
			System.out.println(e);
		} catch (NumberFormatException e) {
			System.out.println("??°?????§??\??????????????????");
		}
	}
}

Compiler output:
Main.java:97: error: illegal escape character
			System.out.println("???????????\??????????????????");
			                                ^
1 error
Language: Java

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

public class Main1 {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int count = Integer.parseInt(br.readLine());

		double[] listX = new double[count];
		double[] listY = new double[count];

		String[] str01 = br.readLine().split(" ");
		for (int i = 0; i < count; i++) {
			listX[i] = Double.parseDouble(str01[i]);
		}

		String[] str02 = br.readLine().split(" ");
		for (int i = 0; i < count; i++) {
			listY[i] = Double.parseDouble(str02[i]);
		}
		for (int i = 1; i < 5; i++) {
			Method.math(listX, listY, i);
		}
	}
}

class Method {

	static void math(double[] listX, double[] listY, int code) {
		double sum = 0;

		if (code == 1) {
			for (int i = 0; i < listX.length; i++) {
				sum += Math.abs(listX[i] - listY[i]);
			}

		} else if (code == 2) {
			for (int i = 0; i < listX.length; i++) {
				sum += Math.pow((listX[i] - listY[i]), 2);
			}
			sum = Math.sqrt(sum);

		} else if (code == 3) {
			for (int i = 0; i < listX.length; i++) {
				sum += Math.pow(Math.abs(listX[i] - listY[i]), 3);
			}
			sum = Math.cbrt(sum);

		} else {
			for (int i = 0; i < listX.length; i++) {
				if (sum < Math.abs(listX[i] - listY[i])) {
					sum = Math.abs(listX[i] - listY[i]);
				}
			}
		}
		System.out.println(sum);
	}
}

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

import java.util.*;

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

		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		double[] x = new double[n];
		double[] y = new double[n];
		double d1, sum2, d2, sum3, d3, d4;
		
		for(int i = 0; i < n; i++){
			x[i] = scan.nextDouble();
		}
		for(int i = 0; i < n; i++){
			y[i] = scan.nextDouble();
		}
		d1 += Math.abs(x[i] - y[i]);
		sum2 += Math.pow((Math.abs(x[i] - y[i])), 2);
		d2 += Math.sqrt(sum2);
		sum3 += Math.pow((Math.abs(x[i] - y[i])), 3);
		d3 += Math.cbrt(sum3);
		d4 = Math.max(d4, Math.abs(x[i] - y[i]));
		System.out.println(d1);
		System.out.println(d2);
		System.out.println(d3);
		System.out.println(d4);
	}
}

Compiler output:
Main.java:19: error: cannot find symbol
		d1 += Math.abs(x[i] - y[i]);
		                 ^
  symbol:   variable i
  location: class Main
Main.java:19: error: cannot find symbol
		d1 += Math.abs(x[i] - y[i]);
		                        ^
  symbol:   variable i
  location: class Main
Main.java:20: error: cannot find symbol
		sum2 += Math.pow((Math.abs(x[i] - y[i])), 2);
		                             ^
  symbol:   variable i
  location: class Main
Main.java:20: error: cannot find symbol
		sum2 += Math.pow((Math.abs(x[i] - y[i])), 2);
		                                    ^
  symbol:   variable i
  location: class Main
Main.java:22: error: cannot find symbol
		sum3 += Math.pow((Math.abs(x[i] - y[i])), 3);
		                             ^
  symbol:   variable i
  location: class Main
Main.java:22: error: cannot find symbol
		sum3 += Math.pow((Math.abs(x[i] - y[i])), 3);
		                                    ^
  symbol:   variable i
  location: class Main
Main.java:24: error: cannot find symbol
		d4 = Math.max(d4, Math.abs(x[i] - y[i]));
		                             ^
  symbol:   variable i
  location: class Main
Main.java:24: error: cannot find symbol
		d4 = Math.max(d4, Math.abs(x[i] - y[i]));
		                                    ^
  symbol:   variable i
  location: class Main
8 errors
Language: Java

import java.util.*;

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

		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		double[] x = new double[n];
		double[] y = new double[n];
		double d1, sum2, d2, sum3, d3, d4;
		
		for(int i = 0; i < n; i++){
			x[i] = scan.nextDouble();
		}
		for(int i = 0; i < n; i++){
			y[i] = scan.nextDouble();
		}
		for(int i = 0; i < n; i++){
			d1 += Math.abs(x[i] - y[i]);
			sum2 += Math.pow((Math.abs(x[i] - y[i])), 2);
			sum3 += Math.pow((Math.abs(x[i] - y[i])), 3);
			d4 = Math.max(d4, Math.abs(x[i] - y[i]));
		}		
		d2 += Math.sqrt(sum2);
		d3 += Math.cbrt(sum3);
		System.out.println(d1);
		System.out.println(d2);
		System.out.println(d3);
		System.out.println(d4);
	}
}

Compiler output:
Main.java:20: error: variable d1 might not have been initialized
			d1 += Math.abs(x[i] - y[i]);
			^
Main.java:21: error: variable sum2 might not have been initialized
			sum2 += Math.pow((Math.abs(x[i] - y[i])), 2);
			^
Main.java:22: error: variable sum3 might not have been initialized
			sum3 += Math.pow((Math.abs(x[i] - y[i])), 3);
			^
Main.java:23: error: variable d4 might not have been initialized
			d4 = Math.max(d4, Math.abs(x[i] - y[i]));
			              ^
Main.java:25: error: variable d2 might not have been initialized
		d2 += Math.sqrt(sum2);
		^
Main.java:25: error: variable sum2 might not have been initialized
		d2 += Math.sqrt(sum2);
		                ^
Main.java:26: error: variable d3 might not have been initialized
		d3 += Math.cbrt(sum3);
		^
Main.java:26: error: variable sum3 might not have been initialized
		d3 += Math.cbrt(sum3);
		                ^
Main.java:27: error: variable d1 might not have been initialized
		System.out.println(d1);
		                   ^
Main.java:30: error: variable d4 might not have been initialized
		System.out.println(d4);
		                   ^
10 errors