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

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    double a=0,b=0,c=0,d=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            a+=x[i]-y[i];
        }
        else if(x[i]<y[i]){
            a+=y[i]-x[i];
        }
    }
    printf("%.8lf\n", a);
    for(int i=0;i<n;i++){
        b+=(x[i]-y[i])*(x[i]-y[i]);
    }
    printf("%.8lf\n",sqrt(b));
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            c[i]=x[i]-y[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
        else{
            c[i]=y[i]-x[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
    }
    printf("%.8lf\n",d);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: invalid types 'double[int]' for array subscript
   32 |             c[i]=x[i]-y[i];
      |              ^
a.cc:33:17: error: invalid types 'double[int]' for array subscript
   33 |             if(c[i]>=c[i-1]){
      |                 ^
a.cc:33:23: error: invalid types 'double[int]' for array subscript
   33 |             if(c[i]>=c[i-1]){
      |                       ^
a.cc:34:20: error: invalid types 'double[int]' for array subscript
   34 |                 d=c[i];
      |                    ^
a.cc:38:14: error: invalid types 'double[int]' for array subscript
   38 |             c[i]=y[i]-x[i];
      |              ^
a.cc:39:17: error: invalid types 'double[int]' for array subscript
   39 |             if(c[i]>=c[i-1]){
      |                 ^
a.cc:39:23: error: invalid types 'double[int]' for array subscript
   39 |             if(c[i]>=c[i-1]){
      |                       ^
a.cc:40:20: error: invalid types 'double[int]' for array subscript
   40 |                 d=c[i];
      |                    ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    double a=0,b=0,c=0,d=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            a+=x[i]-y[i];
        }
        else if(x[i]<y[i]){
            a+=y[i]-x[i];
        }
    }
    printf("%.8lf\n", a);
    for(int i=0;i<n;i++){
        b+=(x[i]-y[i])*(x[i]-y[i]);
    }
    printf("%.8lf\n",sqrt(b));
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            c[i]=x[i]-y[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
        else{
            c[i]=y[i]-x[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
    }
    printf("%.8lf\n",d);
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: invalid types 'double[int]' for array subscript
   32 |             c[i]=x[i]-y[i];
      |              ^
a.cc:33:17: error: invalid types 'double[int]' for array subscript
   33 |             if(c[i]>=c[i-1]){
      |                 ^
a.cc:33:23: error: invalid types 'double[int]' for array subscript
   33 |             if(c[i]>=c[i-1]){
      |                       ^
a.cc:34:20: error: invalid types 'double[int]' for array subscript
   34 |                 d=c[i];
      |                    ^
a.cc:38:14: error: invalid types 'double[int]' for array subscript
   38 |             c[i]=y[i]-x[i];
      |              ^
a.cc:39:17: error: invalid types 'double[int]' for array subscript
   39 |             if(c[i]>=c[i-1]){
      |                 ^
a.cc:39:23: error: invalid types 'double[int]' for array subscript
   39 |             if(c[i]>=c[i-1]){
      |                       ^
a.cc:40:20: error: invalid types 'double[int]' for array subscript
   40 |                 d=c[i];
      |                    ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    double a=0,b=0,d=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    double c[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            a+=x[i]-y[i];
            b+=(x[i]-y[i])*(x[i]-y[i]);
        }
        else if(x[i]<y[i]){
            a+=y[i]-x[i];
            b+=(y[i]-x[i])*(y[i]-x[i]);
        }
    }
    printf("%.8lf\n", a);
    printf("%.8lf\n",sqrt(b));
    printf("%.8lf\n",pow(b,1/3))
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            c[i]=x[i]-y[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
        else{
            c[i]=y[i]-x[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
    }
    printf("%.8lf\n",d);
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: expected ';' before 'for'
   30 |     printf("%.8lf\n",pow(b,1/3))
      |                                 ^
      |                                 ;
   31 |     for(int i=0;i<n;i++){
      |     ~~~                          
a.cc:31:17: error: 'i' was not declared in this scope
   31 |     for(int i=0;i<n;i++){
      |                 ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    double a=0,b=0,d=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    double c[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            a+=x[i]-y[i];
            b+=(x[i]-y[i])*(x[i]-y[i]);
            e+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
        }
        else if(x[i]<y[i]){
            a+=y[i]-x[i];
            b+=(y[i]-x[i])*(y[i]-x[i]);
            e+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
        }
    }
    printf("%.8lf\n", a);
    printf("%.8lf\n",sqrt(b));
    printf("%.8lf\n",pow(e,1/3));
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            c[i]=x[i]-y[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
        else{
            c[i]=y[i]-x[i];
            if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
    }
    printf("%.8lf\n",d);
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'e' was not declared in this scope
   22 |             e+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
      |             ^
a.cc:27:13: error: 'e' was not declared in this scope
   27 |             e+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
      |             ^
a.cc:32:26: error: 'e' was not declared in this scope
   32 |     printf("%.8lf\n",pow(e,1/3));
      |                          ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    double a=0,b=0,d=0,e=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    double c[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            a+=x[i]-y[i];
            b+=(x[i]-y[i])*(x[i]-y[i]);
            e+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
        }
        else if(x[i]<y[i]){
            a+=y[i]-x[i];
            b+=(y[i]-x[i])*(y[i]-x[i]);
            e+=(y[i]-x[i])*(y[i]-x[i])*(y[i]-x[i]);
        }
    }
    printf("%.8lf\n", a);
    printf("%.8lf\n",sqrt(b));
    printf("%.8lf\n",pow(e,1/3));
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            c[i]=x[i]-y[i];
        }
        else{
            c[i]=y[i]-x[i];
            }
        if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
    }
    printf("%.8lf\n",d);
return 0;
}



Compiler output:
a.cc:45:11: error: expected constructor, destructor, or type conversion before '(' token
   45 |     printf("%.8lf\n",d);
      |           ^
a.cc:46:1: error: expected unqualified-id before 'return'
   46 | return 0;
      | ^~~~~~
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    double a=0,b=0,d=0,e=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    double c[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            a+=x[i]-y[i];
            b+=(x[i]-y[i])*(x[i]-y[i]);
            e+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
        }
        else if(x[i]<y[i]){
            a+=y[i]-x[i];
            b+=(y[i]-x[i])*(y[i]-x[i]);
            e+=(y[i]-x[i])*(y[i]-x[i])*(y[i]-x[i]);
        }
    }
    printf("%.6lf\n", a);
    printf("%.6lf\n",sqrt(b));
    printf("%.6lf\n",pow(e,1.0/3.0));
    for(int i=0;i<n;i++){
        if(x[i]>=y[i]){
            c[i]=x[i]-y[i];
            if(i==0){
                d=c[i];
            else if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
        else{
            c[i]=y[i]-x[i];
            if(i==0){
                d=c[i];
            }
            else if(c[i]>=c[i-1]){
                d=c[i];
            }
        }
    }
    printf("%.6lf\n",d);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:13: error: expected '}' before 'else'
   38 |             else if(c[i]>=c[i-1]){
      |             ^~~~
a.cc:36:21: note: to match this '{'
   36 |             if(i==0){
      |                     ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    double n;
    double a=0,b=0,d=0,e=0;
    cin>>n;
    double x[n]={};
    double y[n]={};
    double c[n]={};
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        cin>>y[i];
    }
    for(int i=0;i<n;i++){
            a+=abs(x[i]-y[i]);
            b+=abs((x[i]-y[i])*(x[i]-y[i]));
            e+=abs((x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]));
    }
    printf("%.6lf\n", a);
    printf("%.6lf\n",sqrt(b));
    printf("%.6lf\n",pow(e,1.0/3.0));
    for(int i=0;i<n;i++){
            c[i]=abs(x[i]-y[i]);
            if(i==0){
                d=c[i];
            }
            else if(c[i]>=c[i-1]){
                d=c[i];
            }
    }
    printf("%.6lf\n",d);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    9 |     double x[n]={};
      |              ^
a.cc:9:14: error: could not convert 'n' from 'double' to 'long unsigned int'
    9 |     double x[n]={};
      |              ^
      |              |
      |              double
a.cc:9:14: error: size of array 'x' has non-integral type 'double'
a.cc:10:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   10 |     double y[n]={};
      |              ^
a.cc:10:14: error: could not convert 'n' from 'double' to 'long unsigned int'
   10 |     double y[n]={};
      |              ^
      |              |
      |              double
a.cc:10:14: error: size of array 'y' has non-integral type 'double'
a.cc:11:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   11 |     double c[n]={};
      |              ^
a.cc:11:14: error: could not convert 'n' from 'double' to 'long unsigned int'
   11 |     double c[n]={};
      |              ^
      |              |
      |              double
a.cc:11:14: error: size of array 'c' has non-integral type 'double'
Language: C++

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

int main(){
    int n,x[100],y[100];
    double sum[4];
    cin >> n;
    for(int i=0;i<n;i++) cin >> x[i];
    for(int j=0;j<n;j++) cin >> y[i];
    for(int k=0;k<4;k++) sum[k] = 0.0;
    for(int p=1;p<4;p++){
        for(int i=0;i<n;i++){
            sum[p] += pow(fabs(x[i]-y[i],p));
        }
        sum[p] = pow(sum[p],1.0/p);
    }
    for(int i=0;i<n;i++){
        sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
    }
    printf("%.5f\n%.5f\n%.5f\n%.5f\n",sum[1],sum[2],sum[3],sum[0]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:35: error: 'i' was not declared in this scope
   11 |     for(int j=0;j<n;j++) cin >> y[i];
      |                                   ^
a.cc:15:31: error: no matching function for call to 'fabs(int, int&)'
   15 |             sum[p] += pow(fabs(x[i]-y[i],p));
      |                           ~~~~^~~~~~~~~~~~~
In file included from a.cc:3:
/usr/include/c++/14/cmath:250:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::fabs(_Tp)'
  250 |     fabs(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:250:5: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note: candidate: 'double fabs(double)'
  195 | __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:242:3: note: candidate: 'constexpr long double std::fabs(long double)'
  242 |   fabs(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:242:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:238:3: note: candidate: 'constexpr float std::fabs(float)'
  238 |   fabs(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:238:3: note:   candidate expects 1 argument, 2 provided
a.cc:20:39: error: expected ':' before '{' token
   20 |         sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
      |                                       ^
      |                                       :
a.cc:20:39: error: expected primary-expression before '{' token
a.cc:20:39: error: expected ')' before '{' token
   20 |         sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
      |                  ~                    ^
      |                                       )
Language: C++

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

int main(){
    int n,x[100],y[100];
    double sum[4];
    cin >> n;
    for(int i=0;i<n;i++) cin >> x[i];
    for(int j=0;j<n;j++) cin >> y[j];
    for(int k=0;k<4;k++) sum[k] = 0.0;
    for(int p=1;p<4;p++){
        for(int i=0;i<n;i++){
            sum[p] += pow(fabs(x[i]-y[i],p));
        }
        sum[p] = pow(sum[p],1.0/p);
    }
    for(int i=0;i<n;i++){
        sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
    }
    printf("%.5f\n%.5f\n%.5f\n%.5f\n",sum[1],sum[2],sum[3],sum[0]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: no matching function for call to 'fabs(int, int&)'
   15 |             sum[p] += pow(fabs(x[i]-y[i],p));
      |                           ~~~~^~~~~~~~~~~~~
In file included from a.cc:3:
/usr/include/c++/14/cmath:250:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::fabs(_Tp)'
  250 |     fabs(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:250:5: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note: candidate: 'double fabs(double)'
  195 | __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:242:3: note: candidate: 'constexpr long double std::fabs(long double)'
  242 |   fabs(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:242:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:238:3: note: candidate: 'constexpr float std::fabs(float)'
  238 |   fabs(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:238:3: note:   candidate expects 1 argument, 2 provided
a.cc:20:39: error: expected ':' before '{' token
   20 |         sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
      |                                       ^
      |                                       :
a.cc:20:39: error: expected primary-expression before '{' token
a.cc:20:39: error: expected ')' before '{' token
   20 |         sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
      |                  ~                    ^
      |                                       )
Language: C++

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

int main(){
    int n,x[100],y[100];
    double sum[4];
    cin >> n;
    for(int i=0;i<n;i++) cin >> x[i];
    for(int j=0;j<n;j++) cin >> y[j];
    for(int k=0;k<4;k++) sum[k] = 0.0;
    for(int p=1;p<4;p++){
        for(int i=0;i<n;i++){
            sum[p] += pow(fabs(x[i]-y[i]),p);
        }
        sum[p] = pow(sum[p],1.0/p);
    }
    for(int i=0;i<n;i++){
        sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
    }
    printf("%.5f\n%.5f\n%.5f\n%.5f\n",sum[1],sum[2],sum[3],sum[0]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:39: error: expected ':' before '{' token
   20 |         sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
      |                                       ^
      |                                       :
a.cc:20:39: error: expected primary-expression before '{' token
a.cc:20:39: error: expected ')' before '{' token
   20 |         sum[0] = (sum[0]<(x[i]-y[i])?x{i}-y[i]:sum[0]);
      |                  ~                    ^
      |                                       )
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100]={},y[100]={};
    double max=0.0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        double a=fabs(x[i]-y[i]);
        if(a>max) max=a;
        double D1+=a;
        double D2+=(x[i]-y[i])*(x[i]-y[i]);
        double D3+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);
    }
    double D2=sqrt(D2);
    double D3=pow(D3,1/3);
    double D4=max;
    printf("%f\n %f\n %f\n %f\n",D1,D2,D3,D4);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected initializer before '+=' token
   14 |         double D1+=a;
      |                  ^~
a.cc:15:18: error: expected initializer before '+=' token
   15 |         double D2+=(x[i]-y[i])*(x[i]-y[i]);
      |                  ^~
a.cc:16:18: error: expected initializer before '+=' token
   16 |         double D3+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);
      |                  ^~
a.cc:21:34: error: 'D1' was not declared in this scope; did you mean 'D4'?
   21 |     printf("%f\n %f\n %f\n %f\n",D1,D2,D3,D4);
      |                                  ^~
      |                                  D4
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100]={},y[100]={};
    double max=0.0,D1,D2,D3;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        double a=fabs(x[i]-y[i]);
        if(a>max) max=a;
        D1+=a;
        D2+=(x[i]-y[i])*(x[i]-y[i]);
        D3+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);
    }
    double D2=sqrt(D2);
    double D3=pow(D3,1/3);
    double D4=max;
    printf("%f\n %f\n %f\n %f\n",D1,D2,D3,D4);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: redeclaration of 'double D2'
   18 |     double D2=sqrt(D2);
      |            ^~
a.cc:7:23: note: 'double D2' previously declared here
    7 |     double max=0.0,D1,D2,D3;
      |                       ^~
a.cc:19:12: error: redeclaration of 'double D3'
   19 |     double D3=pow(D3,1/3);
      |            ^~
a.cc:7:26: note: 'double D3' previously declared here
    7 |     double max=0.0,D1,D2,D3;
      |                          ^~
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100]={},y[100]={};
    double max=0.0,D1,D2,D3,D2',D3',D4';
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        double a=fabs(x[i]-y[i]);
        if(a>max) max=a;
        D1+=a;
        D2+=(x[i]-y[i])*(x[i]-y[i]);
        D3+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);
    }
    D2'=sqrt(D2);
    D3'=pow(D3,1/3);
    D4'=max;
    printf("%f\n %f\n %f\n %f\n",D1,D2,D3,D4);
    return 0;
}


Compiler output:
a.cc:7:31: warning: multi-character character constant [-Wmultichar]
    7 |     double max=0.0,D1,D2,D3,D2',D3',D4';
      |                               ^~~~~
a.cc:7:39: warning: missing terminating ' character
    7 |     double max=0.0,D1,D2,D3,D2',D3',D4';
      |                                       ^
a.cc:7:39: error: missing terminating ' character
    7 |     double max=0.0,D1,D2,D3,D2',D3',D4';
      |                                       ^~
a.cc:18:7: warning: missing terminating ' character
   18 |     D2'=sqrt(D2);
      |       ^
a.cc:18:7: error: missing terminating ' character
   18 |     D2'=sqrt(D2);
      |       ^~~~~~~~~~~
a.cc:19:7: warning: missing terminating ' character
   19 |     D3'=pow(D3,1/3);
      |       ^
a.cc:19:7: error: missing terminating ' character
   19 |     D3'=pow(D3,1/3);
      |       ^~~~~~~~~~~~~~
a.cc:20:7: warning: missing terminating ' character
   20 |     D4'=max;
      |       ^
a.cc:20:7: error: missing terminating ' character
   20 |     D4'=max;
      |       ^~~~~~
a.cc: In function 'int main()':
a.cc:7:31: error: expected initializer before '\x2c4433'
    7 |     double max=0.0,D1,D2,D3,D2',D3',D4';
      |                               ^~~~~
a.cc:18:7: error: expected ';' before 'D3'
   18 |     D2'=sqrt(D2);
      |       ^
      |       ;
   19 |     D3'=pow(D3,1/3);
      |     ~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100]={},y[100]={};
    double max=0.0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        double a=fabs(x[i]-y[i]);
        if(a>max) max=a;
        double b+=a;
        double c+=(x[i]-y[i])*(x[i]-y[i]);
        double d+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);
    }
    double e=sqrt(c);
    double f=pow(d,1/3);
    double g=max;
    double printf("%f\n %f\n %f\n %f\n",b,e,f,g);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected initializer before '+=' token
   14 |         double b+=a;
      |                 ^~
a.cc:15:17: error: expected initializer before '+=' token
   15 |         double c+=(x[i]-y[i])*(x[i]-y[i]);
      |                 ^~
a.cc:16:17: error: expected initializer before '+=' token
   16 |         double d+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);
      |                 ^~
a.cc:18:19: error: 'c' was not declared in this scope
   18 |     double e=sqrt(c);
      |                   ^
a.cc:19:18: error: 'd' was not declared in this scope
   19 |     double f=pow(d,1/3);
      |                  ^
a.cc:21:41: error: 'b' was not declared in this scope
   21 |     double printf("%f\n %f\n %f\n %f\n",b,e,f,g);
      |                                         ^
a.cc:21:48: error: expression list treated as compound expression in initializer [-fpermissive]
   21 |     double printf("%f\n %f\n %f\n %f\n",b,e,f,g);
      |                                                ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100]={},y[100]={};
    double max=0.0,a,b=0.0,c=0.0,d=0.0;
    cin>>n;
    for(int i=0;i<n;i++){
        double e,f,g;
        cin>>x[i];
        cin>>y[i];
        a=fabs(x[i]-y[i])*1.0;
        b+=a;
        c+=a*a;
        d+=a*a*a;
        if(a>max) max=a;
    }
    e=sqrt(c);
    f=cbrt(d);
    g=max;
    printf("%f\n %f\n %f\n %f\n",b,e,f,g);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'e' was not declared in this scope
   19 |     e=sqrt(c);
      |     ^
a.cc:20:5: error: 'f' was not declared in this scope
   20 |     f=cbrt(d);
      |     ^
a.cc:21:5: error: 'g' was not declared in this scope
   21 |     g=max;
      |     ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100],y[100];
    double max=0.0,a,b=0.0,c=0.0,d=0.0,e,f,g;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        a=fabs(x[i]-y[i])*1.0;
        b+=a;
        c+=a*a;
        d+=a*a*a;
        if(a>max) max=a;
    }
    h=b
    e=sqrt(c);
    f=cbrt(d);
    g=max;
    printf("%f\n %f\n %f\n %f\n",h,e,f,g);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'h' was not declared in this scope
   18 |     h=b
      |     ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int n,x[100],y[100];
    double max=0.0,a,b=0.0,c=0.0,d=0.0,e,f,g,h;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        a=fabs(x[i]-y[i])*1.0;
        b+=a;
        c+=a*a;
        d+=a*a*a;
        if(a>max) max=a;
    }
    h=b
    e=sqrt(c);
    f=cbrt(d);
    g=max;
    printf("%f\n %f\n %f\n %f\n",h,e,f,g);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: expected ';' before 'e'
   18 |     h=b
      |        ^
      |        ;
   19 |     e=sqrt(c);
      |     ~
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <tgmath.c>
using namespace std;

float absolute(float x)
{
	return (x > 0 ? x : -x);
}

float minkowski_dist(float a[], float b[], int n, float p)
{
	float sum = 0.0;
	for (int i = 0; i < n; i++) {
		sum += pow(absolute(a[i] - b[i]), p);
	}
	return pow(sum, 1/p);
}

float chebychev_dist(float a[], float b[], int n)
{
	float max = 0;
	for (int i = 0; i < n; i++) {
		if (absolute(a[i] - b[i]) > max) max = absolute(a[i] - b[i]);
	}
	return max;
}

int main()
{
	int n;
	cin >> n;

	float a[n], b[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];

	for (int i = 0; i < n; i++)
		cin >> b[i];

	printf("%.8f\n%.8f\n%.8f\n%.8f\n",
		minkowski_dist(a, b, n, 1.0), minkowski_dist(a, b, n, 2.0), minkowski_dist(a, b, n, 3.0), chebychev_dist(a, b, n));

	return 0;
}

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

#include<iostream>
#include<cmath>
#include<algorithm>
int main () {
    int n,x[100]={0},y[100]={0}, D1,D2,Dinf;
    cin >> n;
    for(i=0;i<n;i++){
        cin >> x[i];
    }
    for(i=0;i<n;i++){
        cin >> y[i];
    }
    for(i=0;i<n;i++) {
        D1+=abs(x[i]-y[i]);
        D2 += pow(x[i]-y[i],2);
        Dinf =max(x[i]-y[i],x[i+1]-y[i+1]);
    }
    cout << D1 << " " << sqrt(D2) << " " << Dinf << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     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:7:9: error: 'i' was not declared in this scope
    7 |     for(i=0;i<n;i++){
      |         ^
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i=0;i<n;i++){
      |         ^
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     for(i=0;i<n;i++) {
      |         ^
a.cc:16:15: error: 'max' was not declared in this scope; did you mean 'std::max'?
   16 |         Dinf =max(x[i]-y[i],x[i+1]-y[i+1]);
      |               ^~~
      |               std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     cout << D1 << " " << sqrt(D2) << " " << Dinf << 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:18:53: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |     cout << D1 << " " << sqrt(D2) << " " << Dinf << 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 <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	int x[100],y[100];
	int n;
	cin >> n;
	REP(i,n) cin >> x[i];
	REP(j,n) cin >> y[i];
	long double sum = 0;
	REP(i,n) sum += abs(x[i]-y[i]);
	cout << sum << endl;
	sum = 0;
	REP(i,n) sum += (x[i]-y[i])*(x[i]-y[i]);
	cout << setprecision(20) << fixed << sqrt(sum) << endl;
	sum = 0;
	REP(i,n) sum += abs((x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]));
	cout << cbrt(sum) << endl;
	long double ans4 = -9999;
	REP(i,n) ans4 = max(ans3,abs(x[i]-y[i]));
	cout << ans4 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: 'i' was not declared in this scope
   31 |         REP(j,n) cin >> y[i];
      |                           ^
a.cc:42:29: error: 'ans3' was not declared in this scope; did you mean 'ans4'?
   42 |         REP(i,n) ans4 = max(ans3,abs(x[i]-y[i]));
      |                             ^~~~
      |                             ans4
Language: C++

#include <iostream>
#include <cmath>
#include <cstdlib>
 
using namespace std;
 
int main(){
         
	int n;
	cin >> n;
	
	int * X;
	int * Y;
	
	X = new int [n];
	Y = new int [n];
	
	for(int i = 0; i < n; i++){cin >> X[i];}
	for(int i = 0; i < n; i++){cin >> Y[i];}
	
	for(int i = 0; i < 3; i++){
		sum = 0;
		for(int j = 0; j < n; j++){
			sum += pow(abs(X[j] - Y[j]),i+1);
		}
		cout << fixed << pow(sum,(1.0/(i+1.0))) << endl;
	}
	
	double max;
	max = 0;
	for(int i = 0; i < n; i++){
		if(max < abs(X[j] - Y[j]){
			max = abs(X[j] - Y[j];
		}
	}
	cout << fixed << max << endl;
	
	delete[] X;
	delete[] Y;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'sum' was not declared in this scope
   22 |                 sum = 0;
      |                 ^~~
a.cc:32:32: error: 'j' was not declared in this scope
   32 |                 if(max < abs(X[j] - Y[j]){
      |                                ^
a.cc:32:42: error: expected ')' before '{' token
   32 |                 if(max < abs(X[j] - Y[j]){
      |                   ~                      ^
      |                                          )
a.cc:35:9: error: expected primary-expression before '}' token
   35 |         }
      |         ^
Language: C++

#include <iostream>
#include <cmath>
#include <cstdlib>
 
using namespace std;
 
int main(){
         
	int n;
	cin >> n;
	
	int * X;
	int * Y;
	
	X = new int [n];
	Y = new int [n];
	
	for(int i = 0; i < n; i++){cin >> X[i];}
	for(int i = 0; i < n; i++){cin >> Y[i];}
	
	for(int i = 0; i < 3; i++){
		sum = 0;
		for(int j = 0; j < n; j++){
			sum += pow(abs(X[j] - Y[j]),i+1);
		}
		cout << fixed << pow(sum,(1.0/(i+1.0))) << endl;
	}
	
	double max;
	max = 0;
	for(int i = 0; i < n; i++){
		if(max < abs(X[j] - Y[j])){
			max = abs(X[j] - Y[j];
		}
	}
	cout << fixed << max << endl;
	
	delete[] X;
	delete[] Y;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'sum' was not declared in this scope
   22 |                 sum = 0;
      |                 ^~~
a.cc:32:32: error: 'j' was not declared in this scope
   32 |                 if(max < abs(X[j] - Y[j])){
      |                                ^
Language: C++

#include <iostream>
#include <cmath>
#include <cstdlib>
 
using namespace std;
 
int main(){
         
	int n;
	cin >> n;
	
	int * X;
	int * Y;
	
	X = new int [n];
	Y = new int [n];
	
	for(int i = 0; i < n; i++){cin >> X[i];}
	for(int i = 0; i < n; i++){cin >> Y[i];}
	
	for(int i = 0; i < 3; i++){
		double sum;
		sum = 0;
		for(int j = 0; j < n; j++){
			sum += pow(abs(X[j] - Y[j]),i+1);
		}
		cout << fixed << pow(sum,(1.0/(i+1.0))) << endl;
	}
	
	double max;
	max = 0;
	for(int i = 0; i < n; i++){
		if(max < abs(X[i] - Y[i])){
			max = abs(X[i] - Y[i];
		}
	}
	cout << fixed << max << endl;
	
	delete[] X;
	delete[] Y;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:46: error: expected ')' before ';' token
   34 |                         max = abs(X[i] - Y[i];
      |                                  ~           ^
      |                                              )
Language: C++

#include<string>
#include<iostream>
#include<cctype>
#include<cmath>
#include<cstdio>

using namespace std;


double dist1(int n,int *a,int *b){
	int i;
	double sum=0;	
	for(i=0;i<n;i++){
		sum+=fabs(a[i]-b[i]);	
		}
	return sum;
	}

double dist2(int n,int *a,int *b){
	int i;
	double sum=0;	
	for(i=0;i<n;i++){
		sum+=pow(a[i]-b[i],2);	
		}
	return sqrt(sum);
	}
	
double dist3(int n,int *a,int *b){
	int i;
	double sum=0;	
	for(i=0;i<n;i++){
		sum+=pow(fabs(a[i]-b[i]),3.0);	
		}
	return pow(sum,1.0/3);
	}

double dist4(int n,int *a,int *b){
	int i;
	double sum=0;	
	for(i=0;i<n;i++){
		if(sum<=fabs(a[i]-b[i])) sum=fabs(a[i]-b[i]);
		}
	return sum;
	}

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

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

int main(){
	int n;
	cin >> n;
	double x[n],y[n];
	for(i=0;i<n;i++) cin >> x[i];
	for(i=0;i<n;i++) cin >> y[i];
	for(int i=1;i<=3;i++){
		double s = 0;
		for(int j=0;j<n;j++) s += pow(abs(x[j]-y[j]),i);
		s = pow(s,1.0/i);
		cout << setprecision(10) << s << endl;
	}
	double t = 0;
	for(int i=0;i<n;i++) if(t<abs(x[i]-y[i])) t = abs(x[i]-y[i]);
	cout << setprecision(10) << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         for(i=0;i<n;i++) cin >> x[i];
      |             ^
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         for(i=0;i<n;i++) cin >> y[i];
      |             ^
Language: C++

//
//  main.cpp
//  ITP1_10-D
//
//  Created by ?????¶??? on 15/8/15.
//  Copyright (c) 2015??´ ?????¶???. All rights reserved.
//

#include <iostream>
#include <cmath>
#include <vector>
#include <stdio.h>

using namespace std;

int main() {

    int n;
    cin >> n;
    
    double x[n],y[n];
    
    for (int i = 0; i < n; ++i) {
        cin >> x[i];
    }
    
    for (int i = 0; i < n; ++i) {
        cin >> y[i];
    }
    
    // p = 1 ???????????????????????¢
    
    double result_1 = 0;
    for (int i = 0; i < n; i++) {
        
        result_1 += abs(x[i] - y[i]);
    }
    
    
    // p = 2 ???????????????????????¢
    
    double result_2 = 0;
    for (int i = 0; i < n; i++) {
        result_2 +=  pow(abs(x[i] - y[i]), 2.0);
    }
    
    result_2 = sqrt(result_2);
    
    // p = 3
    
    double result_3 = 0;
    for (int i = 0; i < n; i++) {
        result_3 += pow(abs((x[i] - y[i])), 3.0);
    }
    result_3 = cbrt(result_3);
    
    // max ?????§????????§????????¢
    vector<double> tempList;
    
    for (int i = 0; i < n; i++) {
        
        double temp = abs(x[i] - y[i]);
        tempList.push_back(temp);
    }
    
    auto it = max_element(tempList.begin(), tempList.end());
    double result_4 = *it;
    
    printf("%.6f\n", result_1);
    printf("%.6f\n", result_2);
    printf("%.6f\n", result_3);
    printf("%.6f\n", result_4);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:15: error: 'max_element' was not declared in this scope
   66 |     auto it = max_element(tempList.begin(), tempList.end());
      |               ^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#define SQR(X) ( (X) * (X) )

long double minkosu(long sa[],long n,long double p)
{
   long i,j;
   long double tmp=0;
   for(i=0;i<n;i++)
      tmp += powl( fabsl( sa[i] ) ,p);


   return powl(tmp,1/p);
}


int main()
{
   long i,j,k,l;
   long n;
   long x[100];
   long y[100];
   long sa[100];

   cin >> n;

   for(i=0;i<n;i++)
      cin >> x[i];

   for(i=0;i<n;i++) {
      cin >> y[i];
      sa[i] = x[i] - y[i];
   }

   printf("%llf\n",minkosu(sa,n,1));
   printf("%llf\n",minkosu(sa,n,2));
   printf("%llf\n",minkosu(sa,n,3));
   printf("%llf\n",minkosu(sa,n,1000));

   return 0;
}
}

Compiler output:
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

import java.util.Scanner;
public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int n;
		double[] x = new double[111];
		double[] y = new double[111];
		double p, d;
		n = input.nextInt();
		for(int i = 0; i < n; i++)
		{
			x[i]=input.nextDouble();
		}
		for(int i = 0; i < n; i++)
		{
			y[i]=input.nextDouble();
		}
		p = 0;
		for(int i = 0; i < n; i++)
		{
			p += Math.abs(x[i] - y[i]);
		}
		System.out.println(p);
		
		p=0;
		for(int i = 0; i < n; i++)
		{
			p += Math.pow(x[i] - y[i], 2);
		}
		System.out.println(Math.sqrt(p));

		p=0;
		d=1.0/3;
		for(int i = 0; i < n; i++)
		{
			p += Math.pow(Math.abs(x[i] - y[i]), 3);
		}
		System.out.println(Math.pow(p, d));

		p = Math.abs(x[0] - y[0]);
		for(int i = 0; i < n; i++)
		{
			if(p < Math.abs(x[i] - y[i]))
			{
				p = Math.abs(x[i] - y[i]);
			}
		}
		System.out.println(p);
		input.close();
	}
}

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 math

def manhattan(xs, ys):
    return sum([abs(x-y) for x, y in zip(xs, ys)])

def euclid(xs, ys):
    return math.sqrt(sum([(x-y)**2 for x, y in zip(xs, ys)]))

def l3(xs, ys):
    return sum([(x-y)**3 for x, y in zip(xs, ys)])**(1/3)

def chev(xs, ys):
    return max([abs(x-y) for x, y in zip(xs, ys)])

def norm():
    n = int(input())
    xs = list(map(int, input().split()))
    ys = list(map(int, input().split()))
    print(manhattan(xs, ys))
    print(euclid(xs, ys))
    print(l3(xs, ys))
    print(chev(xs, ys))

norm()

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

#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <stdio.h>
#include <cstring>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <numeric>
#include <regex>
#include <locale>
#include <fstream>
#include <stdlib.h>
#include <cctype>

//#include <map>

using namespace std;

int main()
{
	int n;
	vector<int> vx, vy;

	cin >> n;
	cin.ignore();

	string temp;
	{
		getline(fin, temp);
		istringstream iss(temp);
		while (!iss.eof())
		{
			int t;
			iss >> t;
			vx.push_back(t);
			iss.ignore();
		}
	}
	{
		getline(fin, temp);
		istringstream iss(temp);
		while (!iss.eof())
		{
			int t;
			iss >> t;
			vy.push_back(t);
			iss.ignore();
		}
	}

	double D = 0.0;
	double d = 0;
	for (double p = 1.0; p <= 3.0; p += 1.0)
	{
		d = 0.0;
		for (int i = 0; i < n; i++)
		{
			double dd = abs(vx.at(i) - vy.at(i));
			double ddd = pow(dd, p);
			d += pow(abs(vx.at(i) - vy.at(i)) * 1.0, p);
		}
		D = pow(d, 1.0 / p);
		cout << fixed << setprecision(8) << D << endl;
	}

	d = 0.0;
	for (int i = 0; i < n; i++)
	{
		d = max(d, abs(vx.at(i) - vy.at(i)) * 1.0);
	}
	cout << fixed << setprecision(8) << d << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:25: error: 'fin' was not declared in this scope; did you mean 'sin'?
   32 |                 getline(fin, temp);
      |                         ^~~
      |                         sin
a.cc:43:25: error: 'fin' was not declared in this scope; did you mean 'sin'?
   43 |                 getline(fin, temp);
      |                         ^~~
      |                         sin
Language: C++

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

int main(){
	long n;
	cin >> n;
	vector<double> x(n);
	for (long i = 0; i < n; i++){
		cin >> x[i];
	}
	vector<double> y(n);
	for (long i = 0; i < n; i++){
		cin >> y[i];
	}
	double one = 0;
	for (long i = 0; i < n; i++){
		one += abs(x[i] - y[i]);
	}
	cout << one << endl;
	double two = 0;
	for (long i = 0; i < n; i++){
		two += (x[i] - y[i]) * (x[i] - y[i]);
	}
	two = sqrt(two);
	cout << two << endl;
	double three = 0;
	for (long i = 0; i < n; i++){
		three += (abs(x[i] - y[i])) * (x[i] - y[i]) * (x[i] - y[i]);
	}
	cout << three << endl;
	double inf = 0;
	for (long i = 0; i < n; i++){
		if (abs(x[i] - y[i]) > inf) inf = abs(x[i] - y[i]);
	}
	cout << inf << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<double> x(n);
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <cmath>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:8:16: error: expected primary-expression before 'double'
    8 |         vector<double> x(n);
      |                ^~~~~~
a.cc:10:24: error: 'x' was not declared in this scope
   10 |                 cin >> x[i];
      |                        ^
a.cc:12:16: error: expected primary-expression before 'double'
   12 |         vector<double> y(n);
      |                ^~~~~~
a.cc:14:24: error: 'y' was not declared in this scope
   14 |                 cin >> y[i];
      |                        ^
a.cc:18:28: error: 'x' was not declared in this scope
   18 |                 one += abs(x[i] - y[i]);
      |                            ^
a.cc:18:35: error: 'y' was not declared in this scope
   18 |                 one += abs(x[i] - y[i]);
      |                                   ^
a.cc:23:25: error: 'x' was not declared in this scope
   23 |                 two += (x[i] - y[i]) * (x[i] - y[i]);
      |                         ^
a.cc:23:32: error: 'y' was not declared in this scope
   23 |                 two += (x[i] - y[i]) * (x[i] - y[i]);
      |                                ^
a.cc:29:31: error: 'x' was not declared in this scope
   29 |                 three += (abs(x[i] - y[i])) * (x[i] - y[i]) * (x[i] - y[i]);
      |                               ^
a.cc:29:38: error: 'y' was not declared in this scope
   29 |                 three += (abs(x[i] - y[i])) * (x[i] - y[i]) * (x[i] - y[i]);
      |                                      ^
a.cc:34:25: error: 'x' was not declared in this scope
   34 |                 if (abs(x[i] - y[i]) > inf) inf = abs(x[i] - y[i]);
      |                         ^
a.cc:34:32: error: 'y' was not declared in this scope
   34 |                 if (abs(x[i] - y[i]) > inf) inf = abs(x[i] - y[i]);
      |                                ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <string>
#include <stdio>
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int>x(N);
  vector<int>y(N);
  vector<double>out(4);

  for(int i=0;i<N;i++){
    cin >> x[i];
  }
  for(int i=0;i<N;i++){
    cin >> y[i];
  }
  for(int i=0;i<3;i++){
    double sum = 0;
    for(int j=0;j<N;j++){
      sum += pow(abs(x[j]-y[j]), i+1);
    }
    out[i] = pow(sum, 1.0 / (i+1));
  }
  int val=0;
  for(int i=0;i<N;i++){
    val = max(val, abs(x[i] - y[i]));
    out[3] = val;
  }

  for(int i=0;i<4;i++){
    printf("%.10lf\n", out[i]);
  }


  return 0;
}

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


#define _USE_MATH_DEFINES
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <string>
#include <cctype>
#include <algorithm>
#include <climits>
#include <vector>
#include <list>

using namespace std;

double minkowski(double *sub, int p) {
	double sum = 0;
	for (int i = 0; i < sizeof(sub) - 1; i++) {
		sum += pow(sub[i], p);
	}
	return pow(sum, 1 / p);
}

double cheby(double *sub, int n) {
	double max = LDBL_MIN;
	for (int i = 0; i < n; i++) {
		if (max < sub[i]) max = sub[i];
	}
	return max;
}

int main()
{
	int n;
	cin >> n;
	double *x = new double[n];
	double *y = new double[n];
	for (int i = 0; i < n; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> y[i];
	}
	for (int i = 0; i < n; i++) {
		x[i] = fabs(x[i] - y[i]);
	}
	for (auto p : { 1, 2, 3}) {
		printf("%.08f\n", minkowski(x, p));
	}
	printf("%.08f\n", cheby(x, n));
	return 0;
}

Compiler output:
a.cc: In function 'double cheby(double*, int)':
a.cc:25:22: error: 'LDBL_MIN' was not declared in this scope
   25 |         double max = LDBL_MIN;
      |                      ^~~~~~~~
a.cc:13:1: note: 'LDBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   12 | #include <list>
  +++ |+#include <cfloat>
   13 |
Language: C++

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

int main(){
	double m=0,U,u=0,s,c=0,n,x[110],y[110];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x[i];
	}
	for(int i=0;i<n;i++){
		cin>>y[i];
	}
	for(int i=0;i<n;i++){
		m+=fabs(x[i]-y[i]);
	}
	cout<<m<<endl;
	for(int i=0;i<n;i++){
		u+=(x[i]-y[i])*(x[i]-y[i]);
	}
	U=sqrt(u);
	cout<<fixed<<setprecision(6)<<U<<endl;
	s=pow(u,1.0/3.0);
	cout<<fixed<<setprecision(6)<<s<<endl;
	c=fabs(x[0]-y[0]);
	for(int i=0;i<n-1;i++){
		if(c<fabs(x[i+1]-y[i+1]))c=fabs(x[i+1]-y[i+1]);
	}
	cout<<fixed<<setprecision(6)<<c<<endl;
	return 0;
}

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

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

int main(void)
{
	int x[100], y[100],n;
	double p;
/*?°???\??¨???*/
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &x[i]);
	}
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &y[i]);
	}
/*??????????????????????????¢*/
	for (p = 1; p < 4; p++)
	{
		double minkohu = 0;
		for (int a; a < n; a++)
		{
			minkohu = minkohu + pow(fabs(x[a] - y[a]), p);
		}
		printf("%lf\n", minkohu);
		minkohu = 0;
	}
/*?????§????????§????????¢*/
	double distance,num;
	distance = myabs(x[0] - y[0]);
	for (int j = 1; j < n; j++)
	{
		num = myabs(x[j] - y[j]);
		if (num > distance)distance = num;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: 'myabs' was not declared in this scope
   31 |         distance = myabs(x[0] - y[0]);
      |                    ^~~~~