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

#include <iostream>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  double s = 0;
  for (int i = 0; i < N; ++i) {
    cin >> A;
    s += 1/A;
  }
  
  cout << 1/s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A;
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  double s = 0;
  for (int i = 0; i < N; ++i) {
    cin >> A;
    double += 1/A;
  }
  
  cout << 1/s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A;
      |            ^
a.cc:11:12: error: expected unqualified-id before '+=' token
   11 |     double += 1/A;
      |            ^~
Language: C++

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

int main(){
  int n;
  cin >> n;
  
  vector<int> a(n);
  int p = 1;
  for (int& x : a) cin >> x, p *= x;
  
  int ac = 0;
  for (int i = 0; i < n; i++) {
    ac += p / a[i]
  }
  cout << fixed << setprecision(6) << (double)p / ac << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: expected ';' before '}' token
   16 |     ac += p / a[i]
      |                   ^
      |                   ;
   17 |   }
      |   ~
Language: C++

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

int main(){
  int n;
  cin >> n;
  
  vector<int> a(n);
  int p = 1;
  for (int& x : a) cin >> x, p *= x;
  
  int ac = 0;
  for (int i = 0; i < n; i++) {
    ac += pro / a[i]
  }
  cout << fixed << setprecision(6) << (double)p / ac << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'pro' was not declared in this scope
   15 |     ac += pro / a[i]
      |           ^~~
a.cc:17:20: error: 'setprecision' was not declared in this scope
   17 |   cout << fixed << setprecision(6) << (double)p / ac << endl;
      |                    ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    2 | #include<vector>
  +++ |+#include <iomanip>
    3 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  
  vector<int> a(n);
  int p = 1;
  for (int& x : a) cin >> x, p *= x;
  
  int ac = 0;
  for (int i = 0; i < n; i++) {
    ac += pro / a[i]
  }
  cout << fixed << setprecision(6) << (double)p / ac << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> a(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a(n);
      |          ^~~
a.cc:10:17: error: 'a' was not declared in this scope
   10 |   for (int& x : a) cin >> x, p *= x;
      |                 ^
a.cc:14:11: error: 'pro' was not declared in this scope
   14 |     ac += pro / a[i]
      |           ^~~
a.cc:14:17: error: 'a' was not declared in this scope
   14 |     ac += pro / a[i]
      |                 ^
a.cc:16:20: error: 'setprecision' was not declared in this scope
   16 |   cout << fixed << setprecision(6) << (double)p / ac << endl;
      |                    ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include<iostrem>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  int p = 1;
  for (int& x : a) cin >> x, p *= x;
  a.push_back(a.front());
  int ac = 0;
  for (int i = 0; i < n; i++) {
    ac += a[i] * a[i + 1];
  }
  cout << fixed << setprecision(6) << (double)p / ac << endl;
}

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

#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    int a[n],b[n];
    fot(int c=0;c<n;c++){
        scanf("%d",&a[c]);
        b[c]=1/a[c];
    }
    int d=0;
    for(int e=;e<n;e++){
        d+=b[e];
    }
    int f;
    f=1/d;
    printf("%d\n",f);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'fot' [-Wimplicit-function-declaration]
    6 |     fot(int c=0;c<n;c++){
      |     ^~~
main.c:6:9: error: expected expression before 'int'
    6 |     fot(int c=0;c<n;c++){
      |         ^~~
main.c:6:25: error: expected ';' before '{' token
    6 |     fot(int c=0;c<n;c++){
      |                         ^
      |                         ;
main.c:11:15: error: expected expression before ';' token
   11 |     for(int e=;e<n;e++){
      |               ^
main.c:12:9: error: 'd' undeclared (first use in this function)
   12 |         d+=b[e];
      |         ^
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import jav.util.*;
class Main{
  public static void main(String args[]){
    Scanner sc =new Scanner(System.in);
    int n= sc.nextInt();
    int a[]= new int[n];
    double sum=0;
    for(int i=0;i<n;i++){
      a[i]=sc.nextInt();
      sum+=1/a[i];
    }
    System.out.println(1/sum);
  }
}
    

Compiler output:
Main.java:1: error: package jav.util does not exist
import jav.util.*;
^
Main.java:4: error: cannot find symbol
    Scanner sc =new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
    Scanner sc =new Scanner(System.in);
                    ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

int main(){
  int n;
  cin >> n;
  
  vector<double> a(n);
  rep(i,n) cin>>a[i];
  
  rep(i,n) a[i] = 1/a[i];
  
  double s;
  rep(i,n) s += a[i];
    
  double ans = 1/s;
  printf("%.10f\n",ans);
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n;
      |   ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<double> a(n);
      |   ^~~~~~
a.cc:5:10: error: expected primary-expression before 'double'
    5 |   vector<double> a(n);
      |          ^~~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   rep(i,n) cin>>a[i];
      |       ^
a.cc:6:3: error: 'rep' was not declared in this scope
    6 |   rep(i,n) cin>>a[i];
      |   ^~~
a.cc:14:3: error: 'printf' was not declared in this scope
   14 |   printf("%.10f\n",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  double a[100];
  double sum=0;
  for(int i=0;i<n;i++){
    cin >> a[i];
    sum=sum+(1/a[i]);
  }
  sum = (1/sum);
  cout << sum << endl;
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: expected '}' at end of input
   14 |   return 0;
      |            ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int main () {
  int n, ans=0;
  vector<double> a(n);
  for (int i=0;i<n;i++) {
    cin >> a.at(i);
    ans += 1 / a.at(i);
  }
  ans = 1 / ans;
  cout << fixed << setprecision(5)
  cout << ans;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:35: error: expected ';' before 'cout'
   12 |   cout << fixed << setprecision(5)
      |                                   ^
      |                                   ;
   13 |   cout << ans;
      |   ~~~~
Language: C++

include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  int t; cin >> t; double x,ans=0;
  while(t--){
    cin >> x;
    ans += 1/x;
  }
  cout << 1/ans << "\n";
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'ios_base' has not been declared
    5 |   ios_base::sync_with_stdio(0); cin.tie(0);
      |   ^~~~~~~~
a.cc:5:33: error: 'cin' was not declared in this scope
    5 |   ios_base::sync_with_stdio(0); cin.tie(0);
      |                                 ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout << 1/ans << "\n";
      |   ^~~~
Language: C++

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

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  int t; cin >> t; double x,ans=0;
  while(t--){
    cin >> x;
    ans += 1/x;
  }
  cout << 1/ans << "\n";
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected '}' at end of input
   12 |   return 0;
      |            ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    double[] numbers = new double[n];
    double sum = 0;
    while(stdIn.nextLine != null){
      for(int i = 0; i<n; i++){
        numbers[i] = 1.0/nextInt();
        sum += numbers[i];
      }
    }
    System.out.println(1/sum);
    stdIn.close();
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
    while(stdIn.nextLine != null){
               ^
  symbol:   variable nextLine
  location: variable stdIn of type Scanner
Main.java:11: error: cannot find symbol
        numbers[i] = 1.0/nextInt();
                         ^
  symbol:   method nextInt()
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    double[] numbers = new double[n];
    double sum = 0;
    while(stdIn.nextLine != null){
      for(int i = 0; i<n; i++){
        numbers[i] = 1.0/nextInt();
        sum += numbers[i];
      }
    }
    System.out.println(1/sum);
    stdIn.close;
  }
}

Compiler output:
Main.java:16: error: not a statement
    stdIn.close;
         ^
1 error
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    dobule sum = 0;
    String line = sc.nextLine();
    String[] ar = line.split(" ");
    double[] mot = new double[n];
    for(int i = 0; i<n; i++){
      mot[i] = 1/Double.parseDouble(ar[i]);
      sum+=mot[i];
    }
    System.out.println(1/sum);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    dobule sum = 0;
    ^
  symbol:   class dobule
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;

int main(){
  int N;
  cin >>N;
  
  double A;
  double sum = 0.0
  rep(i,0,N){
    cin >> A;
    sum = 1.0/A;
  }
  
  double ans = 1/sum;
  cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:20: error: expected ',' or ';' before 'for'
    2 | #define rep(i,a,n) for(int i=a;i<n;i++)
      |                    ^~~
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,0,N){
      |   ^~~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   rep(i,0,N){
      |       ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,a,n) for(int i=a;i<n;i++)
      |                                ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    double a;
    double d = 0.0;
    double answer = 0.0;
  
    for(int i = 0; i < N; i++) {cin >> a; d += 1/a;}
    
    answer = 1/d;
  
    // 出力
    cout << setprecision(16) << answer << endl;
    return 0;
}


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

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    int a;
    double d = 0.0;
    double answer = 0.0;
  
    for(int i = 0; i < N; i++) {cin >> a; d += 1/a;}
    
    answer = 1/d;
  
    // 出力
    cout << setprecision(16) << answer << endl;
    return 0;
}


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

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    double a;
    double d = 0.0;
    double answer = 0.0;
  
    for(int i = 0; i < N; i++) {cin >> a; d += 1/a;}
    
    double answer = 1/d;
  
    // 出力
    cout << answer << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: redeclaration of 'double answer'
   14 |     double answer = 1/d;
      |            ^~~~~~
a.cc:10:12: note: 'double answer' previously declared here
   10 |     double answer = 0.0;
      |            ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    int a;
    double d = 0.0;
    double answer = 0.0;
  
    for(int i = 0; i < N; i++) {cin >> a; d += 1/a;}
    
    double answer = 1/d;
  
    // 出力
    cout << answer << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: redeclaration of 'double answer'
   14 |     double answer = 1/d;
      |            ^~~~~~
a.cc:10:12: note: 'double answer' previously declared here
   10 |     double answer = 0.0;
      |            ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    int a;
    double d = 0.0
    double answer = 0.0;
  
    for(int i = 0; i < N; i++) {cin >> a; d += 1/a;}
    
    double answer = 1/d;
  
    // 出力
    cout << answer << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'double'
   10 |     double answer = 0.0;
      |     ^~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
    
    int N,A;
    cin >> N;
    
    int i;
    
    double sum = 0;
    
    for(i=0;i<N;i++){
        
        cin >> A;
        
        sum += 1/A;
    }
    
    sum = 1/sum;
    
    cout << setprecision(16) << sum << endl;
    
        
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'setprecision' was not declared in this scope
   23 |     cout << setprecision(16) << sum << endl;
      |             ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 |
Language: C++

#include <iostream>

using namespace std;

int main(){
    
    int N,A;
    cin >> N;
    
    int i;
    
    double sum = 0;
    
    for(i=0;i<N;i++){
        
        cin >> A;
        
        sum += 1/A;
    }
    
    sum = 1/sum;
    
    cout << setprecision(16) << 1/sum << endl;
    
        
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'setprecision' was not declared in this scope
   23 |     cout << setprecision(16) << 1/sum << endl;
      |             ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    int A;
  cin>>N>>A;
    int sum;
    int pi;
  
  
  for(int i=0; i<N; i++){
      sum+= A.at(i);
      pi= pi*A.at(i);
  }
  
  cout<<1/sum/pi<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: request for member 'at' in 'A', which is of non-class type 'int'
   13 |       sum+= A.at(i);
      |               ^~
a.cc:14:16: error: request for member 'at' in 'A', which is of non-class type 'int'
   14 |       pi= pi*A.at(i);
      |                ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    int A;
  cin>>N>>A;
    int sum;
    int pi;
  
  vector<int> A(N);
  for(int i=0; i<N; i++){
      sum+= A.at(i);
      pi= pi*A.at(i);
  }
  
  cout<<1/sum/pi<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: conflicting declaration 'std::vector<int> A'
   11 |   vector<int> A(N);
      |               ^
a.cc:6:9: note: previous declaration as 'int A'
    6 |     int A;
      |         ^
a.cc:13:15: error: request for member 'at' in 'A', which is of non-class type 'int'
   13 |       sum+= A.at(i);
      |               ^~
a.cc:14:16: error: request for member 'at' in 'A', which is of non-class type 'int'
   14 |       pi= pi*A.at(i);
      |                ^~
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int> mao(n);
  for (int i=0; i<n; i++)
    cin>> mao.at(i);
  
  double z=0;
  for (int i=0; i<n; i++) {
    z += (mao.at(i))**(-1)
  }
  
  cout<< 1/z <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: invalid type argument of unary '*' (have 'int')
   13 |     z += (mao.at(i))**(-1)
      |                      ^~~~~
Language: Java

import java.util.*;
import java.io.*;

class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;
    
    int n = Integer.parseInt(st.nextToken());
    st = new StringTokenizer(br.readLine());
    int a[] = new int[n];
    for(int i=0 ; i<n ; i++) {
      a[i] = Integer.parseInt(st.nextToken());
    }
    
    long lcmans = a[0];
    for(int i=1 ; i<n ; i++) {
      lcmans = lcm(lcmans, a[i]);
    }
    
    long sum = 0;
    for(int i=0 ; i<n ; i++) {
      sum += lcmans/a[i];
    }
    
    System.out.println((double)lcmans/sum);
  }
  
  static long gcd(long a, long b) {
    return (b==0) ? a : gcd(b,a%b);
  }
  
  static long lcm(long a, long b) {
    return (a*b)/gcd(a,b);
  }
}

Compiler output:
Main.java:9: error: variable st might not have been initialized
    int n = Integer.parseInt(st.nextToken());
                             ^
1 error
Language: C++

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

typedef long long int ll;


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    
    long double A[n];
    for(int i = 0; i < n; i++)cin >> A[i];
    long double x = 0;
    for(int i = 0; i < n; i++) x+=(1/A[i]);

    x = (1/x);
  	cout << x;
    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'ios_base' has not been declared
    8 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin.tie(NULL);
      |     ^~~
a.cc:9:13: error: 'NULL' was not declared in this scope
    9 |     cin.tie(NULL);
      |             ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | include<bits/stdc++.h>
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << x;
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 101;
int n;
double arr[MAXN];
int main(){
  cin >> n;
  double sum = 0;
  for (int i = 1; i<=n; i++){
    cin >> arr[i];
    sum += ((double)1/arr[i]));
  }
  cout << (double)1/sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected ';' before ')' token
   11 |     sum += ((double)1/arr[i]));
      |                              ^
      |                              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 101;
int n;
double arr[MAXN]'
int main(){
  cin >> n;
  double sum = 0;
  for (int i = 1; i<=n; i++){
    cin >> arr[i];
    sum += ((double)1/arr[i]));
  }
  cout << (double)1/sum << endl;
  return 0;
}

Compiler output:
a.cc:5:17: warning: missing terminating ' character
    5 | double arr[MAXN]'
      |                 ^
a.cc:5:17: error: missing terminating ' character
a.cc:6:1: error: expected initializer before 'int'
    6 | int main(){
      | ^~~
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 A = 0;
    double B = 1;
    for (int i=0;i<N;i++){
      double n = scan.nextDouble();
      A+=n;
      B*=n;
    }
    System.out.println(B/A);
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util*;
                ^
1 error
Language: C++

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner(System.in);
        int a1 = scan.nextInt();
        float total = 0;
        float f[] = new float[10000];
        for(int i = 0; i < a1; i++){
            f[i] = scan.nextFloat();
            total += 1/f[i];
        }
        System.out.println(1/total);
    }
}


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

#include <iostream>
#include <vector>

using namespace std;

int sosu(double a){
  for (int i = 2; i <=  a; i++) {
        if (a % i == 0) return i;
    }
}

int main(){
  int n;
  double a[1000], arr[1000];
  double answer = 1;
  double mox = 0;
  
  for(int i = 0; i<n; i++){
    cin>>a[i];
  	arr[i] = a[i];
  }
  
  for (int i = 0; i < n; i++) {
        while (arr[i] != 1) {
            int tp = sosu(a[i]);
            answer = answer * tp;
            for (int j = 0; j < n; j++) {
                if (arr[j] % tp == 0) arr[j] = arr[j] / tp;
            }
        }
    }
  
  for (int i = 0; i<n; i++)
    mox = mox + a[i]/answer;
  
  cout << answer/mox;
}
  

Compiler output:
a.cc: In function 'int sosu(double)':
a.cc:8:15: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    8 |         if (a % i == 0) return i;
      |             ~ ^ ~
      |             |   |
      |             |   int
      |             double
a.cc: In function 'int main()':
a.cc:28:28: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   28 |                 if (arr[j] % tp == 0) arr[j] = arr[j] / tp;
      |                     ~~~~~~ ^ ~~
      |                          |   |
      |                          |   int
      |                          double
a.cc: In function 'int sosu(double)':
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  double N;
  cin >> N;
  
  vector<double> A(N)
    for(int i=0; i<N; i++) {
      cin >> A.at(i);
    }
  for(int i=0; i<N; i++) {
    cout << 1/A.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(int i=0; i<N; i++) {
      |     ^~~
a.cc:10:18: error: 'i' was not declared in this scope
   10 |     for(int i=0; i<N; i++) {
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  double N;
  cin >> N;
  
  vector<double> A(N)
    for(double i=0; i<N; i++) {
      cin >> A.at(i);
    }
  for(double i=0; i<N; i++) {
    cout << 1/A.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(double i=0; i<N; i++) {
      |     ^~~
a.cc:10:21: error: 'i' was not declared in this scope
   10 |     for(double i=0; i<N; i++) {
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
double main() {
  
  double N;
  cin >> N;
  
  vector<double> A(N)
    for(double i=0; i<N; i++) {
      cin >> A.at(i);
    }
  for(double i=0; i<N; i++) {
    cout << 1/A.at(i) << endl;
  }
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | double main() {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(double i=0; i<N; i++) {
      |     ^~~
a.cc:10:21: error: 'i' was not declared in this scope
   10 |     for(double i=0; i<N; i++) {
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
double main() {
  
  double N;
  cin >> N;
  
  vector<double> A(N)
    for(double i=0; i<N; i++) {
      cin >> A(i);
    }
  for(double i=0 i<N; i++) {
    cout << 1/A(i) << endl;
  }
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | double main() {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(double i=0; i<N; i++) {
      |     ^~~
a.cc:10:21: error: 'i' was not declared in this scope
   10 |     for(double i=0; i<N; i++) {
      |                     ^
a.cc:13:17: error: expected ';' before 'i'
   13 |   for(double i=0 i<N; i++) {
      |                 ^~
      |                 ;
a.cc:14:16: error: no match for call to '(std::vector<double>) (double&)'
   14 |     cout << 1/A(i) << endl;
      |               ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
double main() {
  
  double N;
  cin >> N;
  
  vector<double> A(N)
    for(double i=0; i<N i++) {
      cin >> A(i);
    }
  for(double i=0 i<N i++) {
    cout << 1/A(i) << endl;
  }
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | double main() {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(double i=0; i<N i++) {
      |     ^~~
a.cc:10:21: error: 'i' was not declared in this scope
   10 |     for(double i=0; i<N i++) {
      |                     ^
a.cc:13:17: error: expected ';' before 'i'
   13 |   for(double i=0 i<N i++) {
      |                 ^~
      |                 ;
a.cc:13:21: error: expected ';' before 'i'
   13 |   for(double i=0 i<N i++) {
      |                     ^~
      |                     ;
a.cc:14:16: error: no match for call to '(std::vector<double>) (double&)'
   14 |     cout << 1/A(i) << endl;
      |               ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N;
  cin >> N;
  
  vector<int> A(N)
    for(int i=0; i<N i++) {
      cin >> A(i);
    }
  for(int i=0 i<N i++) {
    cout << 1/A(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(int i=0; i<N i++) {
      |     ^~~
a.cc:10:18: error: 'i' was not declared in this scope
   10 |     for(int i=0; i<N i++) {
      |                  ^
a.cc:13:14: error: expected ';' before 'i'
   13 |   for(int i=0 i<N i++) {
      |              ^~
      |              ;
a.cc:13:18: error: expected ';' before 'i'
   13 |   for(int i=0 i<N i++) {
      |                  ^~
      |                  ;
a.cc:14:16: error: no match for call to '(std::vector<int>) (int&)'
   14 |     cout << 1/A(i) << endl;
      |               ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N;
  cin >> N;
  
  vector<int> A(N)
    for(int i=0; i<N i++) {
      cin >> A(N);
    }
  for(int i=0 i<N i++) {
    cout << 1/A(N) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(int i=0; i<N i++) {
      |     ^~~
a.cc:10:18: error: 'i' was not declared in this scope
   10 |     for(int i=0; i<N i++) {
      |                  ^
a.cc:13:14: error: expected ';' before 'i'
   13 |   for(int i=0 i<N i++) {
      |              ^~
      |              ;
a.cc:13:18: error: expected ';' before 'i'
   13 |   for(int i=0 i<N i++) {
      |                  ^~
      |                  ;
a.cc:14:16: error: no match for call to '(std::vector<int>) (int&)'
   14 |     cout << 1/A(N) << endl;
      |               ~^~~
Language: C++

#include<bits/stdc++>
using namespace std;
void main()
{int j;
 cin>>j;
 cout<<"\n";
 int a[n];
 for (int i=0;i<n;i++)
 {cin>>a[i];
  
 }
float sum=0;
 
for (int f=0;f<n;f++)
     {sum=sum+(1/f);
     }
cout<<1/sum;
}

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

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

int main(){
  int N;
  vector<int> vec(N);
  vector<int> g(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
    g.at(i) = 1/vec.at(i);
  }
  int sum = sum(g.begin(),g.end());
  cout << 1/sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'sum' cannot be used as a function
   13 |   int sum = sum(g.begin(),g.end());
      |             ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define print(a,n) rep(i,0,n){ cout<<(i ? " ":"")<<a[i]; }cout<<endl;
const long mod=1e9+7;
int main(){
	int N;cin>>N;
	double A[N];double sum=0;
	rep(i,0,N){
		cin>>A[i];sum+=1/A[i];
	}cout<<precision(15)<<1/sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'precision' was not declared in this scope
   11 |         }cout<<precision(15)<<1/sum<<endl;
      |                ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> v(N);
  for (int i=0; i< N; i++) {
    cin >> v[i];
  }
  
  int s = 0;
  for(int i=0; i< N; i++){
    s += 1/A[i];
  }
  
  cout << 1/s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'A' was not declared in this scope
   15 |     s += 1/A[i];
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> A(N);
  for (int i=0; i< N; i++) {
    cin >> A.at(i);
  }
  
  int s = 0;
  for (int i=0; i< N; i++) {
     s += 1/A(i);   
  }
  
  cout << 1/s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: no match for call to '(std::vector<int>) (int&)'
   15 |      s += 1/A(i);
      |             ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> A(N);
  for (int i=0; i< N; i++) {
    cin >> A.at(i);
  }
  
  int s = 0;
  for (int i; i< N; i++) {
     cout << 1/A(i);
     s += 1/A(i);
  }
  
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: no match for call to '(std::vector<int>) (int&)'
   15 |      cout << 1/A(i);
      |                ~^~~
a.cc:16:14: error: no match for call to '(std::vector<int>) (int&)'
   16 |      s += 1/A(i);
      |             ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> A(N);
  for (int i=0; i< N; i++) {
    cout << A.at(i);
  }
  
  int s = 0;
  for (int i; i< N; i++) {
     cout << 1/A(i);
     s += 1/A(i);
  }
  
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: no match for call to '(std::vector<int>) (int&)'
   15 |      cout << 1/A(i);
      |                ~^~~
a.cc:16:14: error: no match for call to '(std::vector<int>) (int&)'
   16 |      s += 1/A(i);
      |             ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> A(N);
  if (int i=0; i< N; i++) {
    cout << A.at(i);
  }
  
  int s = 0;
  if (int i; i< N; i++) {
     cout << 1/A(i);
     s += 1/A(i);
  }
  
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ')' before ';' token
    9 |   if (int i=0; i< N; i++) {
      |      ~             ^
      |                    )
a.cc:9:22: error: 'i' was not declared in this scope
    9 |   if (int i=0; i< N; i++) {
      |                      ^
a.cc:14:18: error: expected ')' before ';' token
   14 |   if (int i; i< N; i++) {
      |      ~           ^
      |                  )
Language: C

#include<stdio.h>

int main(void){
  int sum=0;
  int s; /*最後の計算の値*/
  int i;
  int num;
  int a[1000];
  scanf("%d",&num); /*Nの数を決めてもらう*/
  
  for(i=0; i<num; i++){
    scanf("%d",&a[i]); /*1000の中から値が決まる*/
    sum=sum+1/"%d";     /*値がランダムに決められていき、逆数として合計される*/
  }
  //s=1/sum;			
    printf("%d",1/sum);　　
  return 0;
}  

Compiler output:
main.c: In function 'main':
main.c:13:14: error: invalid operands to binary / (have 'int' and 'char *')
   13 |     sum=sum+1/"%d";     /*値がランダムに決められていき、逆数として合計される*/
      |              ^
      |              |
      |              char *
main.c:16:24: error: stray '\343' in program
   16 |     printf("%d",1/sum);<U+3000><U+3000>
      |                        ^~~~~~~~
main.c:16:26: error: stray '\343' in program
   16 |     printf("%d",1/sum);<U+3000><U+3000>
      |                                ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int t, n;
  double sum = 0;
  cout << t;
  while(t--){
  	cin >> num;
    sum += (double)(1.0/(double)num);
  }
  cout << 1.0/sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'num' was not declared in this scope; did you mean 'sum'?
    8 |         cin >> num;
      |                ^~~
      |                sum
Language: C

#include<stdio.h>

struct record{
	double a;
    double b;
}
int main(void)
{
    int a,i;
    double sum=0;
  
    scanf("%d",&a);
  
    struct record c[a];
  
    for(i=0;i<a;i++){
    	scanf("%lf",&c[i].a);
     	c[i].b = 1.0 / c[i].a;
  		sum = sum + c[i].b;
    }
    printf("%f",sum);
	return 0; 
}

Compiler output:
main.c:7:1: error: expected ';', identifier or '(' before 'int'
    7 | int main(void)
      | ^~~
Language: C

#include<stdio.h>

struct record{
	double a;
    double b;
}
int main(void)
{
    int a,i;
    double sum=0;
  
    scanf("%d",&a);
  
    struct record c[a];
  
    for(i=0;i<a;i++){
    	scanf("%d",&c[i].a);
     	c[i].b = 1.0 / c[i].a;
  		sum = sum + c[i].b;
    }
    printf("%f",sum);
	return 0; 
}

Compiler output:
main.c:7:1: error: expected ';', identifier or '(' before 'int'
    7 | int main(void)
      | ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  double a[1100];
  double sum = 0.0;
  
  cin >> N;
  for(int i = 0; i < N; i++){
  	cin >> a[i];
    sum += 1.0 / a[i];
  }
  
  sum = 1.0 / a[i];
  cout << sum << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'i' was not declared in this scope
   15 |   sum = 1.0 / a[i];
      |                 ^
Language: C++

#include<stdio.h>

void main()
{
	int n;
	do{
		scanf("%d", &n);
	}while((n<1) || (n>100));

	float sum = 0;
	int a;
	for(int i=0; i<n; i++)
	{
		scanf("%d", &a);
		sum = sum + 1/(float)a;
	}
	sum = (float) 1/sum;

	printf("%f", sum);
}


Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

double findval(double arr[],int n)
{
  double inv = 0;
  
  for(int i=0; i<n; i++) inv += 1/arr[i];
  
  return 1/inv;
}

int main()
{
  int n;
  cin >> n;
  
  int arr[n];
  
  for(int i=0; i<n; i++) cin >> arr[i];
  
  cout << findval(arr,n) << endl;
  
  return 0;
  
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: cannot convert 'int*' to 'double*'
   23 |   cout << findval(arr,n) << endl;
      |                   ^~~
      |                   |
      |                   int*
a.cc:5:23: note:   initializing argument 1 of 'double findval(double*, int)'
    5 | double findval(double arr[],int n)
      |                ~~~~~~~^~~~~
Language: C

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

int main(void){
  float A;
  float s;
  float p;
  int n;
  char str[5000];
  
  scanf("%d",&n);
  scanf("%s",str);
  
  s=(float)(strtok(str,"\0"));
  p=s;
  A=1.0/p;
  while(s=(float)(strtok(NULL,"\0"))){
    p=s
    A+=1.0/p;
  }
  A=1.0/A;
  
  printf("%f",A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:3: error: pointer value used where a floating-point was expected
   15 |   s=(float)(strtok(str,"\0"));
      |   ^
main.c:18:3: error: pointer value used where a floating-point was expected
   18 |   while(s=(float)(strtok(NULL,"\0"))){
      |   ^~~~~
main.c:19:8: error: expected ';' before 'A'
   19 |     p=s
      |        ^
      |        ;
   20 |     A+=1.0/p;
      |     ~
Language: C

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

int main(void){
  float A;
  float s;
  float p;
  int n;
  char str[5000];
  
  scanf("%d",&n);
  scanf("%s",str);
  
  s=(float)(strtok(str," "));
  p=s;
  A=1.0/p;
  while(s=(float)(strtok(NULL," "))){
    p=s
    A+=1.0/p;
  }
  A=1.0/A;
  
  printf("%f",A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:3: error: pointer value used where a floating-point was expected
   15 |   s=(float)(strtok(str," "));
      |   ^
main.c:18:3: error: pointer value used where a floating-point was expected
   18 |   while(s=(float)(strtok(NULL," "))){
      |   ^~~~~
main.c:19:8: error: expected ';' before 'A'
   19 |     p=s
      |        ^
      |        ;
   20 |     A+=1.0/p;
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
/*
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(), (c).end());
const long long MOD = 10e9 + 7;
typedef long long ll;
*/

int main(){
	int N;
	double sum = 0;
	vector<double> A(N);
	rep(i, N){
		cin >> A[i];
		sum += (1 / A[i]);
	}
	sum = 1 / sum;
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         rep(i, N){
      |             ^
a.cc:15:9: error: 'rep' was not declared in this scope
   15 |         rep(i, N){
      |         ^~~
Language: C++

#include<iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    int a[N];
    doucle k=1.0;
    for(int i=0;i<N;i++){
        cin >> a[i];
        k = k+a[i];
    }
    double d=0.0;
    for(int i=0;i<N;i++){
        d = d + k/a[i];
    }
    cout << (k/d) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'doucle' was not declared in this scope; did you mean 'double'?
    9 |     doucle k=1.0;
      |     ^~~~~~
      |     double
a.cc:12:9: error: 'k' was not declared in this scope
   12 |         k = k+a[i];
      |         ^
a.cc:16:17: error: 'k' was not declared in this scope
   16 |         d = d + k/a[i];
      |                 ^
a.cc:18:14: error: 'k' was not declared in this scope
   18 |     cout << (k/d) << endl;
      |              ^
Language: Java

package AtCoderBeginnerContest138;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		List<Double> list = new ArrayList<Double>();
		for (int i = 0; i < N; i++) {
			list.add(Double.parseDouble(sc.next()));
		}

		double ans = list.stream().mapToDouble(s -> 1.0 / s).sum();

		ans = 1.0 / ans;
		
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}

}


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

import java.util.*;

public class main {
    public static void Main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n=s.nextInt();
        List<Double> l = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            l.add(s.nextDouble());
        }
        double ans=0;
        for(int i=0;i<n;i++){
            ans+=(1/l.get(i));
        }
        System.out.println(1/ans);
    }
}

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

using System;
using System.Text.RegularExpressions;



class Program
{
    static void Main(string[] args)
    {
        int num;
        Double sum = 0,len = 1;
        int.TryParse(Console.ReadLine(), out num);
        foreach (string x in Regex.Split(Console.ReadLine(), @"\s+"))
        {
            sum += Convert.ToDouble(x);
            len *= Convert.ToDouble(x);
        };
        Console.Write("{0}",len/sum);
    }
}

Compiler output:
a.cc:13:62: error: stray '@' in program
   13 |         foreach (string x in Regex.Split(Console.ReadLine(), @"\s+"))
      |                                                              ^
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Text.RegularExpressions;
      |       ^~~~~~
a.cc:8:22: error: 'string' has not been declared
    8 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:8:31: error: expected ',' or '...' before 'args'
    8 |     static void Main(string[] args)
      |                               ^~~~
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:11:9: error: 'Double' was not declared in this scope; did you mean 'double'?
   11 |         Double sum = 0,len = 1;
      |         ^~~~~~
      |         double
a.cc:12:12: error: expected unqualified-id before '.' token
   12 |         int.TryParse(Console.ReadLine(), out num);
      |            ^
a.cc:13:18: error: 'string' was not declared in this scope
   13 |         foreach (string x in Regex.Split(Console.ReadLine(), @"\s+"))
      |                  ^~~~~~
a.cc:13:9: error: 'foreach' was not declared in this scope
   13 |         foreach (string x in Regex.Split(Console.ReadLine(), @"\s+"))
      |         ^~~~~~~
a.cc:18:9: error: 'Console' was not declared in this scope
   18 |         Console.Write("{0}",len/sum);
      |         ^~~~~~~
a.cc:18:29: error: 'len' was not declared in this scope
   18 |         Console.Write("{0}",len/sum);
      |                             ^~~
a.cc:18:33: error: 'sum' was not declared in this scope; did you mean 'num'?
   18 |         Console.Write("{0}",len/sum);
      |                                 ^~~
      |                                 num
Language: Java

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

public class Main {
    public static void main(String args[]){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        float result;
        try {
            int N = Integer.parseInt(br.readLine());
            int v;
            int save = 1;
            int box[] = new int[N];
            for (int i=0; i<N ; i++) {
                v = Integer.parseInt(br.readLine());
                box[i] = v;
                save = save*v/gcd(save,v);
            }
            
            int denomi = 0;
            int nume = 1;
            for (int j=0; j<N ; j++) {
            		denomi += save/box[j];
            		nume = nume*box[j];
            }
            
            result = nume/denomi;
            
        } catch (Exception e) {
            //TODO: handle exception
        }
        
        System.out.println(result);
    }
    
    private static int gcd(int a, int b) {
        BigInteger b1 = BigInteger.valueOf(a);
        BigInteger b2 = BigInteger.valueOf(b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.intValue();
    }
}

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

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

public class Main {
    public static void main(String args[]){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int N = Integer.parseInt(br.readLine());
            int v;
            int save = 1;
            int box[] = new int[N];
            for (int i=0; i<N ; i++) {
                v = Integer.parseInt(br.readLine());
                box[i] = v;
                save = save*v/gcd(save,v);
            }
            
            int denomi = 0;
            int nume = 1;
            for (int j=0; j<N ; j++) {
            		denomi += save/box[j];
            		nume = nume*box[j];
            }
            
            int result = nume/denomi;
            
        } catch (Exception e) {
            //TODO: handle exception
        }
        
        System.out.println(result);
    }
    
    private static int gcd(int a, int b) {
        BigInteger b1 = BigInteger.valueOf(a);
        BigInteger b2 = BigInteger.valueOf(b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.intValue();
    }
}

Compiler output:
Main.java:33: error: cannot find symbol
        System.out.println(result);
                           ^
  symbol:   variable result
  location: class Main
1 error
Language: Java

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

public class Main {
    public static void main(String args[]){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int N = Integer.parseInt(br.readLine());
            int v;
            int save = 1;
            int box[] = new int[N];
            for (int i=0; i<N ; i++) {
                v = Integer.parseInt(br.readLine());
                box[i] = v;
                save = save*v/gcd(save,v);
            }
            
            int denomi = 0;
            int nume = 1;
            for (int j=0; j<N ; j++) {
            		donomi += save/box[j];
            		nume = nume*box[j];
            }
            
            float result = nume/denomi;
            
        } catch (Exception e) {
            //TODO: handle exception
        }
        
        System.out.println(result);
    }
    
    private static int gcd(int a, int b) {
        BigInteger b1 = BigInteger.valueOf(a);
        BigInteger b2 = BigInteger.valueOf(b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.intValue();
    }
}

Compiler output:
Main.java:22: error: cannot find symbol
            		donomi += save/box[j];
            		^
  symbol:   variable donomi
  location: class Main
Main.java:32: error: cannot find symbol
        System.out.println(result);
                           ^
  symbol:   variable result
  location: class Main
Main.java:36: error: cannot find symbol
        BigInteger b1 = BigInteger.valueOf(a);
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:36: error: cannot find symbol
        BigInteger b1 = BigInteger.valueOf(a);
                        ^
  symbol:   variable BigInteger
  location: class Main
Main.java:37: error: cannot find symbol
        BigInteger b2 = BigInteger.valueOf(b);
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:37: error: cannot find symbol
        BigInteger b2 = BigInteger.valueOf(b);
                        ^
  symbol:   variable BigInteger
  location: class Main
Main.java:38: error: cannot find symbol
        BigInteger gcd = b1.gcd(b2);
        ^
  symbol:   class BigInteger
  location: class Main
7 errors