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

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin >> n;
  int value[n];
  for(i=0; i<n; i++){
    cin >> value[i];
  }
  for(i=0; i<n; i++){
    value[i] = 1/value[i];
  }
  
  int msum;
  for(i=0; i<n; i++){
    msum += value[i];
  }
  
  msum = 1/msum;
  cout << msum << endl;
  
  
  
}


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

#include <iostream>

int main(){
    int A[100],N;
    float AA=0;
    cin >>N;
    for(int i=0;i<N;i++){
        cin>>A[i];
    AA+=1/A[i];
    }
    AA=1/AA;
    cout <<AA;
    return 0;
}

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:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     cout <<AA;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <cstdint>
#include <utility>
#include <tuple>
#include <map>    
#include <queue> 
#include <set>  
#include <stack> 
#include <deque>  
#include <unordered_map> 
#include <unordered_set> 
#include <bitset>

#include <bits/stdc++.h>
using namespace std;
struct Phanso
{
	double tuso;
	double mauso;

};

Phanso sum(Phanso, Phanso);
Phanso ketqua_tmp;
Phanso ketqua;
int main()
{

	int N;
	cin >> N;
	double tmp;
	double ans;
	tmp = 0;
	ans = 0;
	
	vector<int> s(N);
	for (int i = 0; i < N; i++) {
		cin >> s[i];

		if (N == 1) {
			cout << s[i] << endl;
		}

		if (i == 1) {
			Phanso f1 = { 1, s[i - 1] };
			Phanso f2 = { 1, s[i] };
			ketqua = sum(f1, f2);
			ketqua_tmp = ketqua;
		}
		else if (i > 1) {
			//Phanso f1 = { 1, s[i - 1] };
			Phanso f2 = { 1, s[i] };
			ketqua = sum(ketqua_tmp, f2);
			ketqua_tmp = ketqua;
		}
		
	}

	ans = ketqua.mauso / ketqua.tuso;
	cout << ans << endl;

	return 0;

}

Phanso sum(Phanso f1, Phanso f2)
{
	Phanso ketqua = { (f1.tuso * f2.mauso) + (f2.tuso * f1.mauso), f1.mauso * f2.mauso };
	return ketqua;

}

Phanso ans(Phanso f1, Phanso f2)
{
	Phanso ketqua = { (f1.tuso * f2.mauso) + (f2.tuso * f1.mauso), f1.mauso * f2.mauso };
	return ketqua;

}

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 <stdlib.h>

int main(void){
  int size;
  double *seq;
  double child=0;
  scanf("%d",&size);

  if((seq=malloc(size*sizeof(double)))==NULL){
    printf("error");
    exit(1);
  }

  for(int i=0;i<size;i++){
    scanf("%lf",&seq[i]);
    child+=(1.0/seq[i]);
  }

  printf("%f\n",1.0/child);

  free(seq);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
   10 |   if((seq=malloc(size*sizeof(double)))==NULL){
      |           ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
Language: C++

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

Compiler output:
a.cc:6:9: warning: integer constant is too large for its type
    6 |   int A[122222222222222222222253];
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: size '-5904010177266785363' of array 'A' is negative
a.cc:10:11: error: 'i' was not declared in this scope
   10 |   cout<<A[i]/1/1<<endl;
      |           ^
Language: Java

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int f = 0;
Float a[]=new Float[N];
for(i=0;i<N;i++){
f=sc.nextInt();
a[i]=1/f;
}
float sum = java.util.Arrays.stream(a).sum();
float T = 1/sum;
System.out.println(T);
}
}

Compiler output:
Main.java:8: error: cannot find symbol
for(i=0;i<N;i++){
    ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
for(i=0;i<N;i++){
        ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
for(i=0;i<N;i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
a[i]=1/f;
  ^
  symbol:   variable i
  location: class Main
Main.java:10: error: incompatible types: int cannot be converted to Float
a[i]=1/f;
      ^
Main.java:12: error: cannot find symbol
float sum = java.util.Arrays.stream(a).sum();
                                      ^
  symbol:   method sum()
  location: interface Stream<Float>
6 errors
Language: C++

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

int main() {
    int n; cin >> n;
    int a[n];
    int sum = 0;
    for (int i = 0; i < n; i++) cin >> a[i];
    int mul = 1, sum = 0;
    for (int i = 0; i < n; i++) {
        mul *= a[i];
        int sum2 = 1;
        for (int j = 0; j < n-1; j++) {
            if (j == i) continue;
            sum2 *= a[j];
        }
        sum += sum2;
    }
    cout << (double)mul/sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: redeclaration of 'int sum'
    9 |     int mul = 1, sum = 0;
      |                  ^~~
a.cc:7:9: note: 'int sum' previously declared here
    7 |     int sum = 0;
      |         ^~~
Language: C++

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

int main() {
  int128_t n, s = 0, t = 1;
  cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; i++){
    cin >> v.at(i);
    t *= v.at(i);
  }
  for(int i = 0; i < n; i++)
    s += (t / v.at(i));
  double u = (t / s);
  cout << u << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
    5 |   int128_t n, s = 0, t = 1;
      |   ^~~~~~~~
      |   int8_t
a.cc:6:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin >> n;
      |          ^
      |          yn
a.cc:10:5: error: 't' was not declared in this scope
   10 |     t *= v.at(i);
      |     ^
a.cc:13:5: error: 's' was not declared in this scope
   13 |     s += (t / v.at(i));
      |     ^
a.cc:13:11: error: 't' was not declared in this scope
   13 |     s += (t / v.at(i));
      |           ^
a.cc:14:15: error: 't' was not declared in this scope
   14 |   double u = (t / s);
      |               ^
a.cc:14:19: error: 's' was not declared in this scope
   14 |   double u = (t / s);
      |                   ^
Language: C

#include <stdio.h>

int main()
{
  int a, n;
  double math = 0;
  
  scanf("%d", &a);
  
  for(i = 0; i < a; i++)
  {
    scanf("%d", &n);
    math += 1.0/n;
  }
  
  printf("%f\n", 1/math);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: 'i' undeclared (first use in this function)
   10 |   for(i = 0; i < a; i++)
      |       ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;cin>>N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  double ans=0.0;
  for (int j=0; j<N;j++){
    ans += 1/A.at(j);
  }
  
  cout<<1/ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A(N);
      |          ^~~
a.cc:8:12: error: 'A' was not declared in this scope
    8 |     cin >> A.at(i);
      |            ^
a.cc:13:14: error: 'A' was not declared in this scope
   13 |     ans += 1/A.at(j);
      |              ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<ll> vvll;
#define sort(v) sort(v.begin(), v.end())
#define rev(r) reverse(r.begin(), r.end());
#define cout(cc) cout << cc << endl;
int main() {
  double N,tax,max,aaa;
  cin >> N;
  vll VV(N);
  aaa=1;
  rep(i,N){
  	cin >> VV.at(i);
    aaa*=VV.at(i);
  }
  auto BB=VV;
  rep(i,N){
  	auto BB=VV;
    BB.at(i)=1;
    max=1;
    rep(j,N){
      max*=BB.at(j);
    }
    tax+=max;
  }
  cout << abc/tax << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: 'abc' was not declared in this scope; did you mean 'abs'?
   30 |   cout << abc/tax << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;cin>>N;
  vector<int) A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  double ans=0.0;
  for (int j=0; j<N;j++){
    ans += 1/A.at(j);
  }
  
  cout<<1/ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int) A(N);
      |          ^~~
a.cc:8:12: error: 'A' was not declared in this scope
    8 |     cin >> A.at(i);
      |            ^
a.cc:13:14: error: 'A' was not declared in this scope
   13 |     ans += 1/A.at(j);
      |              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;


int main(void)
{
    int N;
    cin >> N;
    vector<int> v(N);
    double ans,rev_ans = 0;
    for(int i = 0; i<N; i++)
    {
        cin >> A.at(i);
    }
    sort(A.begin(),A.end());
    for(int i = N-1; i >= 0; i--)
    {
        rev_ans += 1.0/(double)A.at(i); 
    }
    
    ans = 1.0/rev_ans;

    printf("%f",ans);

}    

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'A' was not declared in this scope
   14 |         cin >> A.at(i);
      |                ^
a.cc:16:10: error: 'A' was not declared in this scope
   16 |     sort(A.begin(),A.end());
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int b,sum=1,summ=0,arr[1000],n;
  cin>>n;
  for(int i=0; i<n; i++)
    {
  cin>>arr[i];}
  for(int i=0; i<n; i++)
    {
    int sum=sum*arr[i];
    int summm=summ+arr[i];
    }
    
    cout<<sum/summ<<endl;
 

	
	
	}
}

Compiler output:
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 入力
		int a = sc.nextInt();
	    int b;
      	double result = 0.0;
		for (i = 0; i < a; i++){
          	b = sc.nextInt();
      		sum=sum+1.0/Math.sqrt(b);
	    }
	}
}


Compiler output:
Main.java:9: error: cannot find symbol
		for (i = 0; i < a; i++){
		     ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
		for (i = 0; i < a; i++){
		            ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
		for (i = 0; i < a; i++){
		                   ^
  symbol:   variable i
  location: class Main
Main.java:11: error: cannot find symbol
      		sum=sum+1.0/Math.sqrt(b);
      		^
  symbol:   variable sum
  location: class Main
Main.java:11: error: cannot find symbol
      		sum=sum+1.0/Math.sqrt(b);
      		    ^
  symbol:   variable sum
  location: class Main
5 errors
Language: C++

#include<stdio.h>
#include<cstdlib>
#include<iostream>
#include<string>
#include<sstream>

using namespace std;


int main(){
    int N;
    cin >> N;
    int A[N];
    string s;
    getline(cin,s);
    double test=0;
    for (int i = 0; i < N; i++){
        A[i] = (int)(s[i] - "0");
        test += 1.0/A[i];
    }
    cout << (1.0/test) <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   18 |         A[i] = (int)(s[i] - "0");
Language: Java

import java.util.Scanner;

public class B_ResistorsInParallel {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.nextLine());
        String[] an = sc.nextLine().split(" ");

        // 分母の最小公倍数を求める
        long molec = 0L;
        for (String elm : an) {
            int i = Integer.parseInt(elm);

            if (molec == 0L) {
                molec = gcd(i, i);
            } else {
                molec = gcd(i, molec);
            }
        }

        // 分子の計算
        long denom = 0L;
        for (String elm : an) {
            int i = Integer.parseInt(elm);
            long times = molec / i;
            denom += times;
        }

        // 答え
        System.err.println(molec + "/" + denom);
        double ans = (double) molec / (double) denom;
        System.out.println(ans);
    }

    private static long gcd(long a, long b) {
        long tmp;
        long c = a;
        c *= b;
        while ((tmp = a % b) != 0) {
            a = b;
            b = tmp;
        }
        return c / b;
    }

}



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

#include<iostream>
using namespace std;
int main()
{int n;
 cin>>n;
 int a[n];
 float r;s=0.0;
 for(int i=0;i<n;i++)
 {cin>>a[i];
  s=s+(float)1/a[i];
 }
 r=(float)1/s;
 cout<<r;
 return 0;}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 's' was not declared in this scope
    7 |  float r;s=0.0;
      |          ^
Language: Java

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int S1 = 0;
int S2 = 1;
for(int i=0;i<N;i++){
int f = sc.nextInt();
S1=S1+f;
S2=S2*f;
}
flort t = S2/S1;
System.out.println("t");
}
}


Compiler output:
Main.java:13: error: cannot find symbol
flort t = S2/S1;
^
  symbol:   class flort
  location: class Main
1 error
Language: C++

#include <stdio.h>
#include <stdlib.h>

int main(void){
  int size;
  double *seq;
  double child=0;
  scanf("%d",&size);

  if((seq=malloc(size*sizeof(double)))==NULL){
    printf("error");
    exit(1);
  }

  for(int i=0;i<size;i++){
    scanf("%lf",&seq[i]);
    child+=(1.0/seq[i]);
  }

  printf("%f\n",1.0/child);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
   10 |   if((seq=malloc(size*sizeof(double)))==NULL){
      |           ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int b,arr[1000],n;
  cin>>n;
  for(int i=0; i<n; i++)
    {
  cin>>arr[i];}
  for(int i=0; i<n; i++)
    {
    int sum*=arr[i];
    int summm+=arr[i];
    }
    
    cout<<sum/summ<<endl;
 

	
	
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected initializer before '*=' token
   12 |     int sum*=arr[i];
      |            ^~
a.cc:13:14: error: expected initializer before '+=' token
   13 |     int summm+=arr[i];
      |              ^~
a.cc:16:11: error: 'sum' was not declared in this scope
   16 |     cout<<sum/summ<<endl;
      |           ^~~
a.cc:16:15: error: 'summ' was not declared in this scope
   16 |     cout<<sum/summ<<endl;
      |               ^~~~
a.cc: At global scope:
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

int main() {
  int N;
  vector<double> A(N);
  
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  
  double res = 0.00000;
  for (int i = 0; i < N; i++) {
    res += 1/A[i];
  }
  double ans = 1/res;
  
  cout <<setprecision(10)<<　ans << endl;
  
  
}

Compiler output:
a.cc:18:28: error: extended character 　 is not valid in an identifier
   18 |   cout <<setprecision(10)<<　ans << endl;
      |                            ^
a.cc: In function 'int main()':
a.cc:18:28: error: '\U00003000ans' was not declared in this scope
   18 |   cout <<setprecision(10)<<　ans << endl;
      |                            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{	int n;
 	cin >> n;
 	float ans;;
  for(int i=1;i<=n;i++)
  {	int temp;
   
    cin >>temp;
   ans += (1/temp);
  }
 cout << (1/temp) << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'temp' was not declared in this scope; did you mean 'tm'?
   13 |  cout << (1/temp) << endl;
      |             ^~~~
      |             tm
Language: C++

x=int(input())
a=[]
n=input().split(" ")
for i in range(0,x):
    a.append(int(n[i]))
S=1
for j in range(0,len(a)):
    S = S * a[j]
t=1
ans=0
for k in range(0,len(a)):
    t=S/a[k]
    ans=ans+t
print(S/ans)

Compiler output:
a.cc:1:1: error: 'x' does not name a type
    1 | x=int(input())
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{int n;
 cin>>n;
 int a[n];
 float r;s=0.0;
 for(int i=0;i<n;i++)
 {cin>>a[i];
  s=s+(float)1/a[i];
 }
 cout<<r;
 return 0;}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 's' was not declared in this scope
    7 |  float r;s=0.0;
      |          ^
Language: C++

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

int main() {
  int N;
  vector<double> A(N);
  
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  
  double res = 0.00000;
  for (int i = 0; i < N; i++) {
    res += 1/A[i];
  }
  double ans = 1/res;
  
  cout <<std::fixed<<　ans << endl;
  
  
}

Compiler output:
a.cc:18:22: error: extended character 　 is not valid in an identifier
   18 |   cout <<std::fixed<<　ans << endl;
      |                      ^
a.cc: In function 'int main()':
a.cc:18:22: error: '\U00003000ans' was not declared in this scope
   18 |   cout <<std::fixed<<　ans << endl;
      |                      ^~~~~
Language: C++

#include <iostream>
#include <math.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
using namespace std;
long long int euclidean_gcd(long long int a, long long int b) {
	if (a < b) return euclidean_gcd(b, a);
	long long int r;
	while ((r = a%b)) {
		a = b;
		b = r;
	}
	return b;
}
int main() {
	long long int N,gc=1,bo=0;
	cin >> N;
	vector<long long int>A(N);
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
		gc=gc*(A[i]/ euclidean_gcd(A[i], gc));
	}
	for (int i = 0; i < N; i++)
	{
		bo += gc / A[i];
	}
	cout << long double(gc)/long double(bo);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: expected primary-expression before 'long'
   34 |         cout << long double(gc)/long double(bo);
      |                 ^~~~
Language: C++

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

int main() {
  int N;
  vector<double> A(N);
  
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  
  double res = 0.00000;
  for (int i = 0; i < N; i++) {
    res += 1/A[i];
  }
  double ans = 1/res;
  
  cout << std::fixed <<　ans << endl;
  
  
}

Compiler output:
a.cc:18:24: error: extended character 　 is not valid in an identifier
   18 |   cout << std::fixed <<　ans << endl;
      |                        ^
a.cc: In function 'int main()':
a.cc:18:24: error: '\U00003000ans' was not declared in this scope
   18 |   cout << std::fixed <<　ans << endl;
      |                        ^~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:18:18: error: expected ';' before 'printf'
   18 |         e = 1 / d
      |                  ^
      |                  ;
   19 |         printf("%d", e);
      |         ~~~~~~
Language: C++

#include<stdio.h>
#include<cstdlib>
#include<iostream>
#include<string>
#include<sstream>

using namespace std;

int main(){
    int N;
    cin >> N;
    int A[N];
    string s;
    getline(cin,s);
    double test=0;
    for (int i = 0; i < N; i++){
        A[i] = stoi(s[i]);
        test += 1.0/A[i];
    }
    cout << (1.0/test) <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   17 |         A[i] = stoi(s[i]);
      |                ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:9:31: error: array subscript is not an integer
    9 |                 scanf("%d", &a[b]);
      |                               ^
main.c:13:26: error: array subscript is not an integer
   13 |                 c = 1 / a[b];
      |                          ^
Language: C++

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

int main() {
  int n, s = 0, t = 1;
  cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; i++){
    cin >> v.at(i);
    s += v.at(i);
    t ＊= v.at(i);
  }
  
  double u = t / s＊(n-1);
  cout << u << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected ';' before '\U0000ff0a'
   11 |     t ＊= v.at(i);
      |      ^~~
      |      ;
a.cc:14:18: error: 's\U0000ff0a' was not declared in this scope
   14 |   double u = t / s＊(n-1);
      |                  ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'a' was not declared in this scope
   10 |     cin>>a[i];
      |          ^
a.cc:16:10: error: 'a' was not declared in this scope
   16 |     sum+=a[i];
      |          ^
Language: C++

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

int main() {
  int n, s = 0, t = 1;
  cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; i++){
    cin >> v.at(i);
    s += v.at(i);
    t ＊= v.at(i)
  }
  
  double u = t / s＊(n-1);
  cout << u << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected ';' before '\U0000ff0a'
   11 |     t ＊= v.at(i)
      |      ^~~
      |      ;
a.cc:14:18: error: 's\U0000ff0a' was not declared in this scope
   14 |   double u = t / s＊(n-1);
      |                  ^~~
Language: Java

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

public class Main
{
	public static void main(String[] args)throws IOException
    {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int size = Integer.parseInt(br.readLine);
      int[] arr = new int[size];
      double sum=0.0;
      StringTokenizer tokenizer1 = new StringTokenizer(br.readLine());
      int j=0;
      while(tokenizer1.hasMoreTokens())
      {
        arr[j] = Integer.parseInt(tokenizer1.nextToken());
        j++;
      }
      for(int i=0;i<size;i++)
      {
        sum += (double)(1/arr[i]);
      }
      double ans = 1/sum;
      System.out.println(ans);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
      int size = Integer.parseInt(br.readLine);
                                    ^
  symbol:   variable readLine
  location: variable br of type BufferedReader
1 error
Language: C++

#include <bits/stc++.h>
using namespace std;
int main()
{
	int b,a,n;
  cin>>n;
  for(int i=0; i<n; i++)
    {
  cin>>a>>b;
    cout<<(a*b)/(a+b)<<endl;
 

	
	
	}
}

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

#include<iostream>
#include<conio.h>
#include<iomanip>
using namespace std;

int main()
{

    int n;
    double s=0,x;
    cin>>n;

    int a[n];

    for(int i=0;i<n;i++){

        cin>>a[i];
        s+=(1.0/a[i]);
    }

    x=(1.0/s);

    cout<<showpoint;
    cout<<setprecision(16);
    cout<<x<<endl;


    return 0;
}


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

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

int main()
{
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  int sum=0;
  for(int i=0;i<n;i++)
  {
    a[i]=1/a[i];
    sum+=a[i]
  }
  sum=1/sum;
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected ';' before '}' token
   20 |     sum+=a[i]
      |              ^
      |              ;
   21 |   }
      |   ~
Language: C++

#include <iostream>

int main(){
  int n;
  int a[100];
  int sum;
  int l;
  int i= 0;

  std::cin >> n;

  //for (int i = 0; i < n; i++){
  for(i=0;i<n;i++)
    std::cin >> a[i];
  }

  for (int j= 0; j< n;j++){
    sum += (1/a[j]);
  }

  sum = 1/sum;

  std::cout << sum << std::endl;

  return 0;

  
}


Compiler output:
a.cc:17:3: error: expected unqualified-id before 'for'
   17 |   for (int j= 0; j< n;j++){
      |   ^~~
a.cc:17:18: error: 'j' does not name a type
   17 |   for (int j= 0; j< n;j++){
      |                  ^
a.cc:17:23: error: 'j' does not name a type
   17 |   for (int j= 0; j< n;j++){
      |                       ^
a.cc:21:3: error: 'sum' does not name a type
   21 |   sum = 1/sum;
      |   ^~~
a.cc:23:8: error: 'cout' in namespace 'std' does not name a type
   23 |   std::cout << sum << std::endl;
      |        ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:3: error: expected unqualified-id before 'return'
   25 |   return 0;
      |   ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include <iomanip>
#define REP(i, n) for(int i = 0; (i) < (n); (i)++)
#define MOD 1000000007
using namespace std;
 
int main(){
  int N;
  long long a = 1, b = 0, c = 0;
  double d;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++){
    cin >> A[i];
    a *= A[i];
    b += A[i];
  }
  for (int i = 0; i < N; i++){
    c += a/A[i];
  }
  cout << fixed;
  cout << setprecision(10)　<< (double) a/c << endl;
}
  

Compiler output:
a.cc:28:27: error: extended character 　 is not valid in an identifier
   28 |   cout << setprecision(10)　<< (double) a/c << endl;
      |                           ^
a.cc: In function 'int main()':
a.cc:28:27: error: expected ';' before '\U00003000'
   28 |   cout << setprecision(10)　<< (double) a/c << endl;
      |                           ^~
      |                           ;
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  float a=0;
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  for(int i=0;i<n;i++)
  { 
     a+=1/a[i];
  }
  float b=1/a;
  cout<<b;
}
   


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: conflicting declaration 'float a'
    8 |   float a=0;
      |         ^
a.cc:7:7: note: previous declaration as 'int a [n]'
    7 |   int a[n];
      |       ^
a.cc:15:7: error: incompatible types in assignment of 'int' to 'int [n]'
   15 |      a+=1/a[i];
      |      ~^~~~~~~~
a.cc:17:12: error: invalid operands of types 'int' and 'int [n]' to binary 'operator/'
   17 |   float b=1/a;
      |           ~^~
      |           | |
      |           | int [n]
      |           int
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  int a[n];
  float a=0;
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  for(int i=0;i<n;i++)
  { 
     a+=1/a[i];
  }
  float b=1/a;
  cout<<b;
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: conflicting declaration 'float a'
    7 |   float a=0;
      |         ^
a.cc:6:7: note: previous declaration as 'int a [n]'
    6 |   int a[n];
      |       ^
a.cc:14:7: error: incompatible types in assignment of 'int' to 'int [n]'
   14 |      a+=1/a[i];
      |      ~^~~~~~~~
a.cc:16:12: error: invalid operands of types 'int' and 'int [n]' to binary 'operator/'
   16 |   float b=1/a;
      |           ~^~
      |           | |
      |           | int [n]
      |           int
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector><int> vec;
  for (int i = 0; i<n; i++) {
    cin >> vec.at(i);
  }
  double sum1;
  for (int i = 0; i<n; i++) {
    sum1 += 1/vec.at(i);
  }
  double sum2;
  sum2 = 1/sum1;
  cout << sum2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected unqualified-id before '>' token
    7 |   vector><int> vec;
      |         ^
a.cc:9:12: error: 'vec' was not declared in this scope
    9 |     cin >> vec.at(i);
      |            ^~~
a.cc:13:15: error: 'vec' was not declared in this scope
   13 |     sum1 += 1/vec.at(i);
      |               ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
 
int main() {
	int m;
	cin>>m;
		float a;
		int s=0;
	for(i=0;i<m;i++){
		cin>>a;
		a=1/a;
		s+=a;
	}
	cout<<s;
	return 0;
}


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

#include<iostream>
using namespace std;
int main()
{int n;
 cin>>n;
 int a[n];
 for(int i=0,i<n;i++)
 cin>>a[i];
 float r,s=0.0;
 for(int i=0;i<n;i++)
 {s=s+(float)1/a[i];}
 r=(float)1/s;
 cout<<r;
 return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected ';' before '<' token
    7 |  for(int i=0,i<n;i++)
      |               ^
      |               ;
a.cc:7:15: error: expected primary-expression before '<' token
Language: C++

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

int main(){
  int N;
  vector<int> A;
  double ANS = 0.0;
  
  cin >> N;
  for(int i=0; i<N; i++){
    cin >> A.at(i);
  }
  
  for(int i=0; i<N; i++){
    ANS += 1/A.at(i)
  }
  
  ANS = 1/ANS;
  
  cout << ANS << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 |     ANS += 1/A.at(i)
      |                     ^
      |                     ;
   16 |   }
      |   ~
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);
  }
  decimal S = 0;
  for (int i = 0; i < N; i++) {
    S += 1 / (A.at(i));
  }
  cout << 1 / S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'decimal' was not declared in this scope; did you mean 'dfmal'?
   11 |   decimal S = 0;
      |   ^~~~~~~
      |   dfmal
a.cc:13:5: error: 'S' was not declared in this scope
   13 |     S += 1 / (A.at(i));
      |     ^
a.cc:15:15: error: 'S' was not declared in this scope
   15 |   cout << 1 / S << endl;
      |               ^
Language: C++

#include<stdio.h>
long long ar[201];
long long gcd(long long x,long long y)
{
  if(b==0)
    return a;
  return gcd(b,a%b);
}
int main()
{
	long long i,mul=1,n,a;
	scanf("%lld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lld",ar+i);
		mul*=ar[i];
	}
	long long sum=0;
	for(i=0;i<n;i++)
		sum+=(mul/ar[i]);
	printf("%0.8f\n",(float)(mul/gcd(mul,sum))/(sum/gcd(mul,sum)));
}


Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:5:6: error: 'b' was not declared in this scope
    5 |   if(b==0)
      |      ^
a.cc:6:12: error: 'a' was not declared in this scope
    6 |     return a;
      |            ^
a.cc:7:14: error: 'b' was not declared in this scope
    7 |   return gcd(b,a%b);
      |              ^
a.cc:7:16: error: 'a' was not declared in this scope
    7 |   return gcd(b,a%b);
      |                ^
Language: Java

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

public final class Main{
    public static void main(String[] args){
        FastScanner stdIn = new FastScanner(System.in);
        
        long n = stdIn.nextInt();
        long[] a = new long[(int)n];
        for(int i=0; i<(int)n; i++){
            a[i] = stdIn.nextInt();
        }
        
        long up = 1;
        double down = 0.0;
        for(int i=0; i<a.length; i++){
            up *= a[i];
        }
        for(int i=0; i<a.length; i++){
            down += (double)up/a[i];
        }

        System.out.println(((double)up/down);
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public long nextInt() {
        return Integer.parseInt(next());
    }

}


Compiler output:
Main.java:23: error: ')' or ',' expected
        System.out.println(((double)up/down);
                                            ^
1 error
Language: C

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <numeric>
#include <utility>
#include <set>

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define IPSILON 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main(){
  int N;
  cin >> N;
  vector<double> A(N);
  for(int i =0;i<N;i++){
    cin >> A[i];
    A[i] = 1/A[i];
  }
  double sum = 0;
  for(auto e: A){
    sum += e;
  }
  cout << 1/sum << endl;
  
  return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

int main(void) {
	int n;
  	std::cin >> n;
  	long double sum = 1, long double s;
  	std::cin >> s;
  	long double temp;
  	for(int i = 0; i < n-1; ++i){
    	std::cin >> temp;
      	sum += s / temp;
    }
  
  	sum = s / sum;
  	std::cout << sum << std::endl;
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:30: error: expected unqualified-id before 'long'
    6 |         long double sum = 1, long double s;
      |                              ^~~~
a.cc:7:21: error: 's' was not declared in this scope
    7 |         std::cin >> s;
      |                     ^
Language: Java



import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] num=new int[n];
        for(int i=0;i<n;i++){
            num[i]=sc.nextInt();
        }
        double ans=0.0;
        for(int i=0;i<n;i++){
            ans+=(double)1/num[i];
        }
        System.out.println(1/ans);
    }
}


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

using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;

struct C1 {
    vector<ll> v_{};
    explicit C1(vector<ll> v) : v_(move(v)){}

    double resolve() {
        double t = 0;
        for(ll d : v_) {
            double x = d;
            t += 1.0/x;
        }
        return (double)1.0/t;
    }
};

int main() {
    ll N;
    cin >> N ;
    vector<ll> v{};
    for (int i=0; i < N; ++i) {
        ll x;
        cin >> x;
        v.emplace_back(x);
    }
    C1 c{move(v)};
    cout.precision(12);
    cout << c.resolve() << endl;
    return 0;
}


Compiler output:
a.cc:3:13: error: 'pair' does not name a type
    3 | using pll = pair<ll, ll>;
      |             ^~~~
a.cc:6:5: error: 'vector' does not name a type
    6 |     vector<ll> v_{};
      |     ^~~~~~
a.cc:7:23: error: expected ')' before '<' token
    7 |     explicit C1(vector<ll> v) : v_(move(v)){}
      |                ~      ^
      |                       )
a.cc: In member function 'double C1::resolve()':
a.cc:11:20: error: 'v_' was not declared in this scope
   11 |         for(ll d : v_) {
      |                    ^~
a.cc: In function 'int main()':
a.cc:21:5: error: 'cin' was not declared in this scope
   21 |     cin >> N ;
      |     ^~~
a.cc:22:5: error: 'vector' was not declared in this scope
   22 |     vector<ll> v{};
      |     ^~~~~~
a.cc:22:14: error: expected primary-expression before '>' token
   22 |     vector<ll> v{};
      |              ^
a.cc:22:16: error: 'v' was not declared in this scope
   22 |     vector<ll> v{};
      |                ^
a.cc:28:10: error: 'move' was not declared in this scope
   28 |     C1 c{move(v)};
      |          ^~~~
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout.precision(12);
      |     ^~~~
a.cc:30:28: error: 'endl' was not declared in this scope
   30 |     cout << c.resolve() << endl;
      |                            ^~~~
Language: C++

import operator
def prod(array):
        result = 1
        for i in range(len(array)):
                result *= array[i]
        return result
n = int(input())
a = list(map(int,input().split()))
print(1/(sum(a)/prod(a)))

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

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

        int n = sc.nextInt();
        long[] a = new long[n];
        long b = 1;
        long c = 1;
        for(int i=0; i< n; i++) {
            a[i] = sc.nextInt();
            b = b*a[i];
        }
        float mo = 0;
        for(int j=0; j< n; j++){
            mo += b/a[j];
        }
        System.out.println(b/mo);

    }
}


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:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vectv<int> v(n);
  for(int i = 0; i < n; i++)
    cin >> v.at(i);
  double s = 0;
  for(int i = 0; i < n; i++){
    double a = 1 / v.at(i);
    s += a;
  }
  double t = 1 / s;
  cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vectv' was not declared in this scope
    7 |   vectv<int> v(n);
      |   ^~~~~
a.cc:7:9: error: expected primary-expression before 'int'
    7 |   vectv<int> v(n);
      |         ^~~
a.cc:9:12: error: 'v' was not declared in this scope
    9 |     cin >> v.at(i);
      |            ^
a.cc:12:20: error: 'v' was not declared in this scope
   12 |     double a = 1 / v.at(i);
      |                    ^
Language: C++

#include <iostream>

using namespace std;

int A[100];
int main(){
	int n;
  cin >> n;
  for(int i=0;i<n;i++){
  	cin >> A[i];
  }
  long double sum = 0;
  for(int i=0;i<n;i++){
  	sum += 1ld / A[i];
  }
  cout << 1ld/sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: unable to find numeric literal operator 'operator""ld'
   14 |         sum += 1ld / A[i];
      |                ^~~
a.cc:16:11: error: unable to find numeric literal operator 'operator""ld'
   16 |   cout << 1ld/sum;
      |           ^~~
Language: Java

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int S1 = 0;
int S2 = 1;
for(i=0;i<N;i++){
int f = sc.nextInt();
S1=S1+f;
S2=S2*f;
}
System.out.println("S2/S1");
}
}

Compiler output:
Main.java:8: error: cannot find symbol
for(i=0;i<N;i++){
    ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
for(i=0;i<N;i++){
        ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
for(i=0;i<N;i++){
            ^
  symbol:   variable i
  location: class Main
3 errors
Language: C++

#include<iostream>
#include<cstdio>

int N;
double A[1000];
double B = 0;

int main(){
  cin >>N;
  for(int i = 0; i<N;i++){
    cin >> A[i];
    B += 1 / A[i];
  }
  B = 1 / B;
  printf("%.9", B);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   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
      |                  ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N; cin>>N;
  vector<int> A;
  for (int i=0;i<N;++i) cin>>A[i];
  
  int ans=0;
  for (int j=0;j<N;++j){
    ans+=1/(A[j]);
  }
  
  cout<<1/ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> A;
      |   ^~~~~~
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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A;
      |          ^~~
a.cc:7:30: error: 'A' was not declared in this scope
    7 |   for (int i=0;i<N;++i) cin>>A[i];
      |                              ^
a.cc:11:13: error: 'A' was not declared in this scope
   11 |     ans+=1/(A[j]);
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#ifdef _IS_LOCAL //
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout   \
	if (false) \
	cout
#define debug() if (false)
#define dvout if(false) cout
#endif //
#define next asdnext
#define prev asdprev
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define vrep(i, v) for (auto &i : v)
#define all(x) (x).begin(), (x).end()
#define vout(v)           \
	for (auto &i : v)     \
	{                     \
		cout << i << " "; \
	}                     \
	cout << "\n"; //配列出力
#define vin(v)        \
	for (auto &i : v) \
		cin >> i; //配列入力
#define vecin(v,n)	\
	vec(v,n);		\
	vin(v);
#define vec(v, n) vector<int> v(n, 0);
#define mod (int)(1e9+7)
typedef long long ll;
typedef unsigned long long ull;
void Main()
{
	int N;
	cin>>N;
	vec(a,N);
	vin(a);
 
	dvout(a);
 
	double ans=0;
	rep(i,N){
		ans += 1.0/a[i];
	}
	ans = 1/ans;
 
	cout<<ans<<endl;
}
 
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:42:14: error: no match for call to '(std::ostream {aka std::basic_ostream<char>}) (std::vector<int>&)'
   42 |         dvout(a);
      |              ^
Language: C++

// #include <stdio.h>
// #include <string.h>
//#include <iostream>
#include <utility>
#include <cstdio>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <string>
#include <set>

using namespace std;
typedef pair<int, int> XY;// Pair型変数の宣言

int Nmax = 100;
int A[Nmax];
    
int main()
{
  	
    char String[Nmax];
    int N;
    int i,j,k;
    int len;   // 文字列の長さ
    int flag=0;
    double tmp;

    

        
    
    // 入力読込

    // 数列
   scanf("%d", &N);
   for(i=1;i<=N;i++){
        scanf("%d ",&A[i]);
    }
    
        // 文字列
//   scanf("%s", String);   
    
    
    // 文字列の長さをチェック
    // 文字列は配列の0からlen-1に格納されてる
//    len = strlen( String );
//  	printf("%d\n",len);
    
    tmp =0;
    for(i=1;i<=N;i++){
        tmp = tmp+ 1.0/double(A[i]);
    }
    
    printf("f\n", 1.0/tmp);
    
 
  
        
  
  return 0;
   
}

Compiler output:
a.cc:17:7: error: size of array 'A' is not an integral constant-expression
   17 | int A[Nmax];
      |       ^~~~
Language: C++

#include <iostream>
#include <iomanip>
using namespace std;
int main(){
  int n;cin>>n;
  int sm = 0;
  for(int i = 0; n > i; i++)int tmp,cin>>tmp;sm+=tmp;
  cout <<  fixed << setprecision(10) << sm/n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: expected initializer before '>>' token
    7 |   for(int i = 0; n > i; i++)int tmp,cin>>tmp;sm+=tmp;
      |                                        ^~
a.cc:7:50: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    7 |   for(int i = 0; n > i; i++)int tmp,cin>>tmp;sm+=tmp;
      |                                                  ^~~
      |                                                  tm
Language: C++

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

int main() {
  int N;
  vector <int> vec(N);
  cin >> N;
  for (int i=0;i<N;i++){
    cin >> vec[i] ;
  }
  int sum = 0;
  for (int j:vec){
    sum += 1/vec[i];
  }
  cout << 1/sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'i' was not declared in this scope
   13 |     sum += 1/vec[i];
      |                  ^