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

import java.util.Scanner;

public class Main{

    public static int gcm(int b,int r){
        int _r;
        if(b<r) return gcm(r,b);
        _r=b%r;
        if(_r==0)return r;
        else gcm(r,_r);
    }

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        long[] T = new long[n];
        for(int i=0;i<n;i++){
          T[i]=scan.nextInt();
        }
        for(int i=0;i<n-1;i++){
          T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]);
        }
        System.out.println(T[n-1]);
    }
}


Compiler output:
Main.java:21: error: incompatible types: possible lossy conversion from long to int
          T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]);
                                  ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.Scanner;

public class Main{

    public static int gcm(int b,int r){
        int _r;
        if(b<r) return gcm(r,b);
        _r=b%r;
        if(_r==0)return r;
        else gcm(r,_r);
    }

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        long int[] T = new int[n];
        for(int i=0;i<n;i++){
          T[i]=scan.nextInt();
        }
        for(int i=0;i<n-1;i++){
          T[i+1]=gcm(T[i+1],T[i])
        }
        System.out.println(T[n-1]);
    }
}


Compiler output:
Main.java:16: error: not a statement
        long int[] T = new int[n];
        ^
Main.java:16: error: ';' expected
        long int[] T = new int[n];
            ^
Main.java:21: error: ';' expected
          T[i+1]=gcm(T[i+1],T[i])
                                 ^
3 errors
Language: C

#include<stdio.h>
long long gcd(long long a,long long b){  
    int temp;  
    if(a < b){  
      temp = a;  
      a = b;  
      b = temp;  
    }    
    if(a%b == 0){  
        return b;    
    }else{    
        return gcd(b,a%b);    
    }    
} 
int main()
{
	long long n;
	long long gcd(long long a,long long b);
    long long  c[109],sum;
	while(~scanf("%d",&n))
	{
		sum=0;
		for(int i=0;i<n;i++)
		scanf("%lld",&c[i]);
		while(n==1)
		{
			scanf("%lld\n",a[0]);
			return 0;
		}
			for(int i=0;i<n-1;i++)
			{	
				sum=(c[i]/gcd(c[i],c[i+1]))*c[i+1];
				c[i+1]=sum;
			}
			printf("%lld\n",sum);
		
	}
}

Compiler output:
main.c: In function 'main':
main.c:27:40: error: 'a' undeclared (first use in this function)
   27 |                         scanf("%lld\n",a[0]);
      |                                        ^
main.c:27:40: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
long long gcd(long long a,long long b){  
    int temp;  
    if(a < b){  
      temp = a;  
      a = b;  
      b = temp;  
    }    
    if(a%b == 0){  
        return b;    
    }else{    
        return gcd(b,a%b);    
    }    
} 
int main()
{
	long long n;
	long long gcd(long long a,long long b);
    long long  c[109],sum;
	while(~scanf("%d",&n))
	{
		sum=0;
		for(int i=0;i<n;i++)
		scanf("%lld",&c[i]);
		while(n==1)
		{
			scanf("%lld",a[0]);
			return 0;
		}
			for(int i=0;i<n-1;i++)
			{	
				sum=(c[i]/gcd(c[i],c[i+1]))*c[i+1];
				c[i+1]=sum;
			}
			printf("%lld\n",sum);
		
	}
}

Compiler output:
main.c: In function 'main':
main.c:27:38: error: 'a' undeclared (first use in this function)
   27 |                         scanf("%lld",a[0]);
      |                                      ^
main.c:27:38: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
unsigned long long int divisor(unsigned long long int a,unsigned long long int b)
{
	unsigned long long int temp;
	if(a<b) {temp=a;a=b;b=temp;}
	while(b!=0)
	{temp=a%b;a=b;b=temp;}
	return (a);
}
unsigned long long int multiple(unsigned long long int a,unsigned long long int b)
{
    int divisor(unsigned long long int a,unsigned long long int b);
	unsigned long long int temp;
	temp=divisor(a,b);
	return (a/temp%b*b);
}
unsigned long long int lcmN(unsigned long long int a[],unsigned long long int len)
{
	unsigned long long int i=0,temp;
	while(i<len-1)
	{
		temp=multiple(a[i],a[i+1]);
		i++;
		a[i]=temp;
	}
	return temp;
}
int main()
{
	unsigned long long int n,i;
	unsigned long long int t[110];
	scanf("%llu",&n);
	for(i=0;i<n;i++)
	{
		scanf("%llu",&t[i]);
	}
	printf("%llu\n",lcmN(t,n));
	return 0;
}

Compiler output:
main.c: In function 'multiple':
main.c:12:9: error: conflicting types for 'divisor'; have 'int(long long unsigned int,  long long unsigned int)'
   12 |     int divisor(unsigned long long int a,unsigned long long int b);
      |         ^~~~~~~
main.c:2:24: note: previous definition of 'divisor' with type 'long long unsigned int(long long unsigned int,  long long unsigned int)'
    2 | unsigned long long int divisor(unsigned long long int a,unsigned long long int b)
      |                        ^~~~~~~
Language: C++

#include <iostream>
  #include <cstdio>
  #include <algorithm>
  #include <cstring>
  #include <string>
  #include <cmath>
  using namespace std;
 #define ll long long
  const int N=10005;
 const int mod=1e9+7;
 const int maxn=1e7;
 la[101];
  gcd(ll x,ll y)
 {     c; m=x,n=y;
    while(y!=0){
      c=x%y;
      x=y;     y=c;    }
   return m/x*n; }
int main()
 {
    int n;
    cin>>n;
     ll m,s,l;
     cin>>m;
    if(n==1) cout<<m<<endl;
    else if(n>1){
         cin>>l;
      s=gcd(l,m);
         for(int i=0;i<n-2;i++){
             cin>>m;
            s=gcd(s,m);
         }
         cout<<s<<endl;
     }
     return 0;
 }

Compiler output:
a.cc:12:2: error: 'la' does not name a type; did you mean 'll'?
   12 |  la[101];
      |  ^~
      |  ll
a.cc:13:3: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive]
   13 |   gcd(ll x,ll y)
      |   ^~~
a.cc: In function 'int gcd(long long int, long long int)':
a.cc:14:8: error: 'c' was not declared in this scope
   14 |  {     c; m=x,n=y;
      |        ^
a.cc:14:11: error: 'm' was not declared in this scope
   14 |  {     c; m=x,n=y;
      |           ^
a.cc:14:15: error: 'n' was not declared in this scope
   14 |  {     c; m=x,n=y;
      |               ^
Language: C

#include<stdio.h>
int divisor(long long int a,long long int b)
{
	long long int temp;
	if(a<b) {temp=a;a=b;b=temp;}
	while(b!=0)
	{temp=a%b;a=b;b=temp;}
	return (a);
}
int multiple(long long int a,long long int b)
{
	long long int divisor(long long int a,long long int b);
	long long int temp;
	temp=divisor(a,b);
	return (a*b/temp);
}
int lcmN(long long int a[],long long int len)
{
	long long int i=0,temp;
	while(i<len-1)
	{
		temp=multiple(a[i],a[i+1]);
		i++;
		a[i]=temp;
	}
	return temp;
}
int main()
{
	long long int n,i;
	long long int t[110];
	scanf("%lld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lld",&t[i]);
	}
	printf("%lld\n",lcmN(t,n));
	return 0;
}

Compiler output:
main.c: In function 'multiple':
main.c:12:23: error: conflicting types for 'divisor'; have 'long long int(long long int,  long long int)'
   12 |         long long int divisor(long long int a,long long int b);
      |                       ^~~~~~~
main.c:2:5: note: previous definition of 'divisor' with type 'int(long long int,  long long int)'
    2 | int divisor(long long int a,long long int b)
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#define	MOD  1000000007;
#define PI = 3.14159265358979323846;
using namespace std;

int main()
{
	int N;
	long long T[100];

	cin >> N;

	for (int i = 0; i < N; i++)
	{
		cin >> T[i];
	}

	sort(T, T + N);

	for (int i = 1; i < T[N - 1]; i++)
	{
		long long A = T[N - 1] * i;
		if (A > ULLONG_MAX)
		{
			break;
		}
		for (int j = 0; j < N - 1; j++)
		{
			if (A % T[j] != 0) {
				break;
			}

			if (j == N - 2) {
				cout << A << endl;
				return 0;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: 'ULLONG_MAX' was not declared in this scope
   27 |                 if (A > ULLONG_MAX)
      |                         ^~~~~~~~~~
a.cc:6:1: note: 'ULLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <cmath>
  +++ |+#include <climits>
    6 | #define MOD  1000000007;
Language: C++

#include <iostream>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b){
    if(a<b) swap(a, b);
    LL g = gcd(a, b);
    return a/(g*b);
}

int main(void){
    int N;  cin >> N;
    ll T;
    ll ans = 1LL;
    for(int i=0; i<N; i++){
        cin >> T;
        ans = lcm(ans, T);
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'll lcm(ll, ll)':
a.cc:12:5: error: 'LL' was not declared in this scope; did you mean 'll'?
   12 |     LL g = gcd(a, b);
      |     ^~
      |     ll
a.cc:13:15: error: 'g' was not declared in this scope
   13 |     return a/(g*b);
      |               ^
Language: C++

# Here your code !


n=gets.to_i
array=[]
n.times{
    array<<gets.to_i
    
    
}

if n==1 
   puts array[0]

else

a=array[0]
i=1

(array.length-1).times{
 b=array[i]
 c=a.lcm(b)
 a=c
 
 i=i+1
    
    
    
    
}


puts a
end
    
    

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #Here
    1 | # Here your code !
      |   ^~~~
a.cc:4:1: error: 'n' does not name a type
    4 | n=gets.to_i
      | ^
a.cc:12:1: error: expected unqualified-id before 'if'
   12 | if n==1
      | ^~
a.cc:33:1: error: 'puts' does not name a type
   33 | puts a
      | ^~~~
Language: C++

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

long long int GCD2(long long int A,long long int B){
	long long int C;
	long long int gcd2;
	if (A<B){
		C=B%A;
		if (C==0){
			gcd2=A;
		}
		if (C!=0){
			gcd2=GCD2(C,A);
		}
	}
	else{
		C=A%B;
		if (C==0){
			gcd2=B;
		}
		if (C!=0){
			gcd2=GCD2(C,B);
		}
	}
	return gcd2;
}

long long int GCD(int N,long long int *T){
	int NN=N/2;
	int new_N;
	int i;
	long long int ans;
	long long int *new_T;
	if (N>1){
		if (N==NN*2){
			new_N=NN;
			new_T=malloc(new_N*sizeof(long long int));
			for (i=0;i<NN;i++){
				new_T[i]=(T[i*2]/GCD2(T[i*2],T[i*2+1]))*T[i*2+1];
			}
		}
		else{
			new_N=NN+1;
			new_T=malloc(new_N*sizeof(long long int));
			for (i=0;i<NN;i++){
				new_T[i]=(T[i*2]/GCD2(T[i*2],T[i*2+1]))*T[i*2+1];
			}
			new_T[new_N-1]=T[N-1];
		}
		ans=GCD(new_N,new_T);
	}

	if (N==1){
		ans=T[0];
	}
	return ans;
}

int main(){
	int N;
	int i;
	scanf("%d",&N);
	long long int *T=malloc(N*sizeof(long long int));
	for (i=0;i<N;i++){
		scanf("%lld",&T[i]);
	}
	long long int ans=GCD(N,T);
	printf("%lld\n",ans);
	return 0;
}


Compiler output:
a.cc: In function 'long long int GCD(int, long long int*)':
a.cc:37:37: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive]
   37 |                         new_T=malloc(new_N*sizeof(long long int));
      |                               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     void*
a.cc:44:37: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive]
   44 |                         new_T=malloc(new_N*sizeof(long long int));
      |                               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     void*
a.cc: In function 'int main()':
a.cc:63:32: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive]
   63 |         long long int *T=malloc(N*sizeof(long long int));
      |                          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                |
      |                                void*
Language: C++

#include <cstdio>
#include <cstdint>
#include <numeric>

int main() {
  int N;
  scanf("%d", &N);

  intmax_t T;
  scanf("%jd", &T);

  for (int i=1; i<N; ++i) {
    intmax_t t;
    scanf("%jd", &t);
    T = std::__detail::__lcm(T, t);
  }

  printf("%jd\n", T);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: '__lcm' is not a member of 'std::__detail'
   15 |     T = std::__detail::__lcm(T, t);
      |                        ^~~~~
Language: C

#include <stdio.h>

long long int gcd(long long int x, long long int y) {
    return y ? gcd(y, x % y) : x;
}

long long int lcm(long long int x, long long int y) {
    return x/gcd(x, y)*y;
}

int main()
{
    int N, i;
    long long int ans = 1LL;
    long long int T;

    scanf("%d", &N);

    for (i = 0; i < N; i++) {
        scanf("%ld" &T);
        ans = lcm(ans, T);
    }
    printf("%lld\n", ans);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:21: error: invalid operands to binary & (have 'char *' and 'long long int')
   20 |         scanf("%ld" &T);
      |               ~~~~~ ^
      |               |
      |               char *
Language: C++

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

ll gcd(ll a,ll b){
 if(b==0) return a;
 return gcd(b,a%b);
}
 
ll lcm(ll a,ll b){
 ll g=gcd(a,b);
 return a/g*b;
}
    
int main(){
 int N;
 cin >> N;
 ll ans = 1LL;

 for(int i=0;i<N;++i)
 {
 ll T;
 cin >>T
 ans = lcm(ans, T)
 }

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: expected ';' before 'ans'
   23 |  cin >>T
      |         ^
      |         ;
   24 |  ans = lcm(ans, T)
      |  ~~~
Language: C++

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

ll gc(ll a,ll b){
 if(b==0) return a;
 return gcd(b,a%b);
}
 
ll lcm(ll a,ll b){
 ll g=gcd(a,b);
 return a/g*b;
}
    
int main(){
 int N;
 cin >> N;
 ll ans = 1LL 

 for(int i=0;i<N;i++)
 {
 ll T;
 cin >>T
 ans = lcm(ans, T)
 }

  cout << ans << endl;

  return 0;
}

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

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

ll gc(ll a,ll b){
 if(b==0) return a;
 return gcd(b,a%b);
}
 
ll lcm(ll a,ll b){
 ll g=gcd(a,b);
 return a/g*b;
}
    
int main(){
 int N;
 cin >> N;
 ll ans = 1LL 

 for(int i=0;i<N;i++)
 {
 ll T;
 cin >>T
 ans = lcm(ans, T)
 }

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc:3:20: error: expected ';' before 'll'
    3 | using ll= long long
      |                    ^
      |                    ;
    4 | 
    5 | ll gc(ll a,ll b){
      | ~~                  
a.cc:10:1: error: 'll' does not name a type
   10 | ll lcm(ll a,ll b){
      | ^~
a.cc: In function 'int main()':
a.cc:18:2: error: 'll' was not declared in this scope
   18 |  ll ans = 1LL
      |  ^~
a.cc:20:14: error: 'i' was not declared in this scope
   20 |  for(int i=0;i<N;i++)
      |              ^
a.cc:27:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
     
int main(){
 int N;
 cin >> N;
 float T[N],tmp,a,b,r,x;
 for(int i=0;i<N;i++)
 {
 cin >> T[i];
 }

 for(int i=0; i<N; ++i) {
    for (int j=i+1; j<N; ++j) {
      if (T[i] < T[j]) {
        tmp =  T[i];
        T[i] = T[j];
        T[j] = tmp;
      }
    }
  }
  
  x=a*b;
  a=T[0];
  b=T[N];
  
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }

  cout << x/b << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: invalid operands of types 'float' and 'float' to binary 'operator%'
   27 |   r = a % b;
      |       ~ ^ ~
      |       |   |
      |       |   float
      |       float
a.cc:31:11: error: invalid operands of types 'float' and 'float' to binary 'operator%'
   31 |     r = a % b;
      |         ~ ^ ~
      |         |   |
      |         |   float
      |         float
Language: C++

#include <bits/stdc++.h>
using namespace std;
     
int main(){
 int N,a,b,r,;
 cin >> N;
 float T[N],tmp;
 for(int i=0;i<N;i++)
 {
 cin >> T[i];
 }

 for(int i=0; i<N; ++i) {
    for (int j=i+1; j<N; ++j) {
      if (T[i] < T[j]) {
        tmp =  T[i];
        T[i] = T[j];
        T[j] = tmp;
      }
    }
  }
  
  x=a*b;
  a=T[0];
  b=T[N];
  
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }

  cout << x/b << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected unqualified-id before ';' token
    5 |  int N,a,b,r,;
      |              ^
a.cc:23:3: error: 'x' was not declared in this scope
   23 |   x=a*b;
      |   ^
Language: C++

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

ll gcd(ll m,ll n){
    if(n==0) return m;
    return gcd(n,m%n);
}

ll lcm(ll m,ll n){
    ll g = gcd(m,n);
    return (m/g)*n;
}

int main(){
    ll ans=1,tmp;
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%lld",&tmp);
        ans = lcm(ans,tmp);
    }
    printf("%lld\n",ans);
};

Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll gcd(ll m,ll n){
      | ^~
a.cc:9:1: error: 'll' does not name a type
    9 | ll lcm(ll m,ll n){
      | ^~
a.cc: In function 'int main()':
a.cc:15:5: error: 'll' was not declared in this scope
   15 |     ll ans=1,tmp;
      |     ^~
a.cc:19:23: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   19 |         scanf("%lld",&tmp);
      |                       ^~~
      |                       tm
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |         ans = lcm(ans,tmp);
      |         ^~~
      |         abs
a.cc:22:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |     printf("%lld\n",ans);
      |                     ^~~
      |                     abs
Language: C++

#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using LL = unsigned long long;
LL gcd(LL a, LL b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
LL lcm(LL a, LL b) {
	LL g = gcd(a, b);
	return a / g * b; // Be careful not to overflow

}
int main() {
	LL n;
	LL a[100] = { 0 };
	cin >> n;
	if (n == 1) {
		LL hoge;
		cin >> hoge;
		cout << hoge;
		return 0;
	}
	for (LL i = 0; i < n; i++) {
		cin >> a[i];
	}
	LL temp = lcm(a[0], a[1]);
	for (LL i = 2; i < n; i++)
	{
		temp = lcm(temp, a[i]);
	}
	cout << temp;
	return 0;
}


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

#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using LL =unsigned long long;
LL gcd(LL a, LL b) {
	 if (b == 0) return a;
	 return gcd(b, a%b);
}
LL lcm(LL a, LL b) {
	LL g = gcd(a, b);
	 return a / g * b; // Be careful not to overflow
	
}
int main() {
	LL n;
	LL a[100] = { 0 };
	cin >> n;
	for (LL i = 0; i < n; i++) {
		cin >> a[i];
	}
	LL temp = (a[0],a[1]);
	for (LL i = 2; i < n; i++)
	{
		temp = lcm(temp, a[i]);
	}
	cout << temp;
	return 0;
}


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

#include<iostream>
using namespace std;

int gcd(int a,int b)
{
	if(b==0)
      return a;
  return (b,a%b);
}

int main()
{
int n,t,i=0,a[100000];
  cin>>t;
  while(t--)
  {
  cin>>a[i++];
  }
  
  for(int j=0;j<i;j++)
    	res=(res*a[j])/gcd(res,a[j]);
  
  cout<<res;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'res' was not declared in this scope
   21 |         res=(res*a[j])/gcd(res,a[j]);
      |         ^~~
a.cc:23:9: error: 'res' was not declared in this scope
   23 |   cout<<res;
      |         ^~~
Language: C++

#include <iostream>

using namespace std;

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

	long long ans = 1;
	long long t;
	for (int i = 0; i < n; i++) {
		cin >> t;
		ans = ans / __gcd(ans, t) * t;
	}

	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: '__gcd' was not declared in this scope
   13 |                 ans = ans / __gcd(ans, t) * t;
      |                             ^~~~~
Language: Java

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class C {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<BigInteger> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add( new BigInteger(sc.next()) );
		}
		List<BigInteger> newList = new ArrayList<>(new HashSet<BigInteger>(list));

		BigInteger result = LCM(newList.get(0), newList.get(1));
		for(int i = 2; i < newList.size(); i++) {
			result = LCM(result, newList.get(i));
		}
		System.out.println(result);
	}

	private static BigInteger LCM(BigInteger a, BigInteger b) {
		return a.multiply(b).divide(a.gcd(b));
	}
}

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

#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
long long gys(long long m,long long n)
{
    long long t;
    int b;
    if(m<n)
    {
        t=m;
        m=n;
        n=t;
    }
    do{
    b=m%n;
    m=n;
    n=b;
    }while(n!=0);
    return m;
}
long long gbs(long long m,long long n)
{
    int b;
    long long sum;
    b=gys(m,n);
    sum=m/b*n;
    return sum;
}
int main()
{
    long long a[105],b;
    int n,i;
    memset(t,0,sizeof(t));
    while(scanf("%d",&n)!=EOF)
    {
        for(i=0;i<n;i++)
        scanf("%lld",&a[i]);
        b=gbs(a[0],a[1]);
        for(i=2;i<n;i++)
        b=gbs(b,a[i]);
        cout<<b<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: 't' was not declared in this scope
   34 |     memset(t,0,sizeof(t));
      |            ^
Language: C++

#include<iostream>
#include<string>
#include<cstudio>
using namespace std;
 
long long gcd(long long a, long long b) {
    if (b > a) {
        long long tmp = a;
        a = b;
        b = tmp;
    }
    if (b == 0)
        return a;
    else
        return gcd(b, a%b);
}
 
int main() {
    int n; 
    long long t[100] = {0};
    long long val;
    scanf("%d", &n);
    scanf(" %lld", &val);
    for (int i=1; i<n; i++) {
        long long tmp;
        scanf(" %lld", &tmp);
        long long r = gcd(val, tmp);
        val = val / r * tmp;
    }
    printf("%lld\n", val);
    return 0;
}

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

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

long long gcd(long long a, long long b) {
    if (b > a) {
        long long tmp = a;
        a = b;
        b = tmp;
    }
    if (b == 0)
        return a;
    else
        return gcd(b, a%b);
}
 
int main() {
    int n; 
    long long t[100] = {0};
    long long val;
    scanf("%d", &n);
    scanf(" %lld", &val);
    for (int i=1; i<n; i++) {
        long long tmp;
        scanf(" %lld", &tmp);
        long long r = gcd(val, tmp);
        val = val / r * tmp;
    }
    printf("%lld\n", val);
    return 0;
}



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

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

int main() {
  int N;
  cin >> N;
  using lint = long;
  auto lcm = [](lint a, lint b) { return a / __gcd(a, b) * b };
  lint res;
  for (int i = 0; i < N; ++i) {
    lint a;
    cin >> a;
    res = i == 0 ? a : lcm(res, a);
  }
  cout << res << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:8:61: error: expected ';' before '}' token
    8 |   auto lcm = [](lint a, lint b) { return a / __gcd(a, b) * b };
      |                                                             ^~
      |                                                             ;
Language: C++

#include<iostream>
using namespace std;
int gcd(int a,int b){
	if(a==0) return b;
	else return gcd(b%a,a);
}
int main(){
	int n;
	int clock[110];
	cin>>n;
	for(int i=0;i<n;i++) cin>>clock[i];
	int temp=clock[0];
	for(int i=1;i<n;i++){
		flag=gcd(temp,clock[i]);
		temp*=(clock[i]/flag);
	}
	cout<<temp<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'flag' was not declared in this scope
   14 |                 flag=gcd(temp,clock[i]);
      |                 ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
ll int gcd(ll int m1,ll int m2){
	return (m2==0)? m1:gcd(m2,m1&m2);
}
int main(){
	ll int n,t[10000],smp,ans=1;
	cin>>n;
	while(n--){
		cin>>smp;
		ans=smp/gcd(ans,smp)*smp;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:8:12: error: two or more data types in declaration of 'm1'
    8 | ll int gcd(ll int m1,ll int m2){
      |            ^~
a.cc:8:21: error: expected ')' before ',' token
    8 | ll int gcd(ll int m1,ll int m2){
      |           ~         ^
      |                     )
a.cc:8:1: error: two or more data types in declaration of 'gcd'
    8 | ll int gcd(ll int m1,ll int m2){
      | ^~
a.cc:8:25: error: expected initializer before 'int'
    8 | ll int gcd(ll int m1,ll int m2){
      |                         ^~~
a.cc: In function 'int main()':
a.cc:12:9: error: two or more data types in declaration of 'n'
   12 |         ll int n,t[10000],smp,ans=1;
      |         ^~
a.cc:12:9: error: two or more data types in declaration of 't'
a.cc:12:9: error: two or more data types in declaration of 'smp'
a.cc:12:9: error: two or more data types in declaration of 'ans'
a.cc:13:14: error: 'n' was not declared in this scope
   13 |         cin>>n;
      |              ^
a.cc:15:22: error: 'smp' was not declared in this scope
   15 |                 cin>>smp;
      |                      ^~~
a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |                 ans=smp/gcd(ans,smp)*smp;
      |                 ^~~
      |                 abs
a.cc:16:25: error: 'gcd' was not declared in this scope
   16 |                 ans=smp/gcd(ans,smp)*smp;
      |                         ^~~
a.cc:18:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

#include <iostream>
using namespace std;
 
long long nod(long long a, long long b)
{
  while (a != b)
    if (a > b)
      a = a mod b;
    else
      b = b mod a;
    return a;
}
 
int main()
{
  int n;
  long long a, b;
  cin >> n;
  cin >> a;
  for (int i = 1; i < n; i++)
  {
    cin >> b;
    a = a / nod(a, b) * b;
  }
  cout << a;
}

Compiler output:
a.cc: In function 'long long int nod(long long int, long long int)':
a.cc:8:12: error: expected ';' before 'mod'
    8 |       a = a mod b;
      |            ^~~~
      |            ;
a.cc:10:12: error: expected ';' before 'mod'
   10 |       b = b mod a;
      |            ^~~~
      |            ;
Language: C++

#include<iostream>
using namespace std;
long long gcd(long long a,long long b)
{
if(!b)return a;return gcd(b,a%b);
}
long long T,N,rez;
int main()
{
cin>>N;
cin>>rez;N--;
while(N--){cin>>T;rez=(rez/gcd(rez,T))*T;
cout<<rez;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C

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

long long int printGCD(long long int v1, long long int v2) {
	long long int a, b, r;

	if(a > b) {
		a = v1;
		b = v2;
	}
	else {
		a = v2;
		b = v1;
	}

	while(b != 0) {
		r = a % b;
		a = b;
		b = r;
	}

	return a;
}
long long int printLCM(long long int v1, long long int v2) {
	long long int a, b, c, GCD, check1, check2, check3;

	a = v1;
	b = v2;
	check1 = 0;
	check2 = 0;
	check3 = 0;
	GCD = printGCD(a, b);
	c = GCD;

	while(a > 0) {
		a = a / 10;
		check1++;
	}
	while(b > 0) {
		b = b / 10;
		check2++;
	}
	while(c > 0) {
		c = c / 10;
		check3++;
	}
	a = v1;
	b = v2;

	if(check1 + check2 - check3 >= 18)
		return 1000000000000000000LL;
	
	return (long long int)(a * b / GCD);
}

int main(void) {
	long long int array[100];
	int N, i;

	scanf("%d", &N);
	for(i = 0; i < N; i++) {
		scanf("%lld", &array[i]);
	}

	for(i = 0; i < N-1; i++) {
		array[i+1] = printLCM(array[i], array[i+1]);
	}

	printf("%lld", array[i]);

Compiler output:
main.c: In function 'main':
main.c:69:9: error: expected declaration or statement at end of input
   69 |         printf("%lld", array[i]);
      |         ^~~~~~
Language: C++

def gcd(a,b):
    if a<b:
     d=a
     a=b
     b=d

    if b==0:
     b=1

    c=a%b

    if c==0:
     return b
    else:
     return 2

def lcm(a,b):
    c=gcd(a,b)
    return a/c*b



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a,b):
      | ^~~
Language: C++

#include 
#include 
#include 
#include 
#include 
using namespace std;
const int INT__MAX = 2147483647;
const int MOD = 1000000007;
long long int gcd(long long int num1, long long int num2) {
long long int a, b, qwe;
if (num1 > num2) {

    a = num1;
    b = num2;

}
else {

    a = num2;
    b = num1;

}
qwe = a%b;
while (qwe != 0) {

    a = b;
    b = qwe;
    qwe = a%b;

}
return b;
}
int main() {
int N;
long long int T[105];
long long int hoge, fuga;

cin >> N;
for (int i = 1; i <= N; i++) {

    cin >> T[i];

}
if(N==1){

cout<<T[1]<<endl;

}else{
hoge = gcd(T[1], T[2]);
fuga = (T[1] / hoge)*T[2];
for (int i = 1; i < N; i++) {

    hoge = gcd(fuga, T[i + 1]);
    fuga = (fuga / hoge)*T[i + 1];

}

cout << fuga << endl;

}
return 0;
}


Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |          ^
a.cc:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |          ^
a.cc:3:10: error: #include expects "FILENAME" or <FILENAME>
    3 | #include
      |          ^
a.cc:4:10: error: #include expects "FILENAME" or <FILENAME>
    4 | #include
      |          ^
a.cc:5:10: error: #include expects "FILENAME" or <FILENAME>
    5 | #include
      |          ^
a.cc: In function 'int main()':
a.cc:38:1: error: 'cin' was not declared in this scope
   38 | cin >> N;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
a.cc:46:1: error: 'cout' was not declared in this scope
   46 | cout<<T[1]<<endl;
      | ^~~~
a.cc:46:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:46:13: error: 'endl' was not declared in this scope
   46 | cout<<T[1]<<endl;
      |             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include
a.cc:58:1: error: 'cout' was not declared in this scope
   58 | cout << fuga << endl;
      | ^~~~
a.cc:58:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:17: error: 'endl' was not declared in this scope
   58 | cout << fuga << endl;
      |                 ^~~~
a.cc:58:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

using namespace std;

typedef unsigned long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

lld gcd(lld x,lld y)
{
	if (y == 0)
	{
		return x;
	}

	return gcd(y,x%y);
}

lld lcm(lld x,lld y)
{
	return x * (y / gcd(x,y));
}

int main()
{
	lld n,t[100] = {0};

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

	if (n == 1)
	{
		cout << t[i] << end;
		return 0;
	}

	lld sol = lcm(t[0],t[1]);

	for(int i = 2; i < n; i++)
	{
		sol = lcm(t[i],sol);
	}

	cout << sol << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:27: error: 'i' was not declared in this scope
   46 |                 cout << t[i] << end;
      |                           ^
Language: C++

#include <algorithm>
#include <iostream>
#include <list>
#include <map> //連想配列
#include <queue>
#include <set> //
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector> //動的配列

using namespace std;
using ll = long long;

ll gcd(ll a, ll b){
  if(b==0)return a;
  return gcd(b,a%b);
}
ll lcm(ll a ,ll b){
  ll g = gcd(a,b);
  return a/g*b;
}
int main() {
  int N;
  cin >> N;

  ll ans = ll 1;
  for(int i=0;i<N;++i){
    ll T;
    cin >> T;
    ans = lcm(ans,T);
  }
  
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: expected primary-expression before numeric constant
   28 |   ll ans = ll 1;
      |               ^
Language: C++

#include <cstdint>
#include <iostream>
 
using namespace std;
 
uint64 gcd(uint64 a, uint64 b)
{
  if (b == 0) {
    return a;
  }
 
  return gcd(b, a % b);
}
 
int main()
{
  uint64 N;
  cin >> N;
 
  uint64 l = 1;
  for (uint64_t i = 0; i < N; i++) {
    uint64 val;
    cin >> val;
    l = l / gcd(l, val) * val;
  }
 
  cout << l << endl;
 
  return 0;
}

Compiler output:
a.cc:6:1: error: 'uint64' does not name a type; did you mean 'uint64_t'?
    6 | uint64 gcd(uint64 a, uint64 b)
      | ^~~~~~
      | uint64_t
a.cc: In function 'int main()':
a.cc:17:3: error: 'uint64' was not declared in this scope; did you mean 'uint64_t'?
   17 |   uint64 N;
      |   ^~~~~~
      |   uint64_t
a.cc:18:10: error: 'N' was not declared in this scope
   18 |   cin >> N;
      |          ^
a.cc:20:9: error: expected ';' before 'l'
   20 |   uint64 l = 1;
      |         ^~
      |         ;
a.cc:22:11: error: expected ';' before 'val'
   22 |     uint64 val;
      |           ^~~~
      |           ;
a.cc:23:12: error: 'val' was not declared in this scope
   23 |     cin >> val;
      |            ^~~
a.cc:24:5: error: 'l' was not declared in this scope
   24 |     l = l / gcd(l, val) * val;
      |     ^
a.cc:24:13: error: 'gcd' was not declared in this scope
   24 |     l = l / gcd(l, val) * val;
      |             ^~~
a.cc:27:11: error: 'l' was not declared in this scope
   27 |   cout << l << endl;
      |           ^
Language: C++

import java.util.Scanner;
import java.util.Arrays;
public class Main{
   public static int getGcd(int x,int y){
     if(y%x==0){
        return x;
     }else{
        return getGcd(y%x,x);
     }//14,21     21%14 7,14 2,7 
   }
      //最小公倍数
   public static int getLcm(int x,int y){
      return x/getGcd(x,y)*y;   
   }

   public static void main(String[]args){
      
      Scanner sc = new Scanner(System.in);
      //System.out.println(getLcm(14,21));
      int N =sc.nextInt();
      int abc[] = new int[N];
      int answer = 1;
      int lcm=0;
      for(int i=0; i<N;i++){
         abc[i] =  sc.nextInt();
       
      }
      Arrays.sort(abc);
      //System.out.println(Arrays.toString(abc));
      for(int j=0;j<N-1;j++){
         abc[j+1]= getLcm(abc[j],abc[j+1]);
         //2つめに =2,3の最小公倍数6を入れる
         //3つめに6,4となり、12が入る
       

      }
      System.out.println(abc[N-1]);
}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Arrays;
      | ^~~~~~
a.cc:2: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++

import java.util.Scanner;
import java.util.Arrays;
public class Begginer70{
   public static int getGcd(int x,int y){
     if(y%x==0){
        return x;
     }else{
        return getGcd(y%x,x);
     }//14,21     21%14 7,14 2,7 
   }
      //最小公倍数
   public static int getLcm(int x,int y){
      return x/getGcd(x,y)*y;   
   }

   public static void main(String[]args){
      
      Scanner sc = new Scanner(System.in);
      //System.out.println(getLcm(14,21));
      int N =sc.nextInt();
      int abc[] = new int[N];
      int answer = 1;
      int lcm=0;
      for(int i=0; i<N;i++){
         abc[i] =  sc.nextInt();
       
      }
      Arrays.sort(abc);
      //System.out.println(Arrays.toString(abc));
      for(int j=0;j<N-1;j++){
         abc[j+1]= getLcm(abc[j],abc[j+1]);
    
      }
      System.out.println(abc[N-1]);
}
}

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

#include <stdio.h>
int main(void)
{
int n=0,i=0,r=0,tmp=0;


scanf("%d",&n);

unsigned __int64 t[200];

	t[0]=1;

for (i=1;i<n+1;++i) {
	scanf("%d",&t[i]);
	
	if(t[i]>t[i-1]){
		tmp=t[i];
		t[i]=t[i-1];
		t[i-1]=tmp;
	}
	int x=t[i]*t[i-1];
	r=t[i]%t[i-1];

	while(r!=0){
		t[i]=t[i-1];
		t[i-1]=r;
		r=t[i]%t[i-1];
	}
	t[i]=x/t[i-1];
}
 printf("%d", t[n]);
}



Compiler output:
main.c: In function 'main':
main.c:9:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 't'
    9 | unsigned __int64 t[200];
      |                  ^
main.c:9:18: error: 't' undeclared (first use in this function)
main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void)
{
int n=0,i=0,r=0,tmp=0;


scanf("%d",&n);

__int64 t[200];

	t[0]=1;

for (i=1;i<n+1;++i) {
	scanf("%d",&t[i]);
	
	if(t[i]>t[i-1]){
		tmp=t[i];
		t[i]=t[i-1];
		t[i-1]=tmp;
	}
	int x=t[i]*t[i-1];
	r=t[i]%t[i-1];

	while(r!=0){
		t[i]=t[i-1];
		t[i-1]=r;
		r=t[i]%t[i-1];
	}
	t[i]=x/t[i-1];
}
 printf("%d", t[n]);
}



Compiler output:
main.c: In function 'main':
main.c:9:1: error: unknown type name '__int64'; did you mean '__int64_t'?
    9 | __int64 t[200];
      | ^~~~~~~
      | __int64_t
Language: C++

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return a // gcd(a, b) * b

N = input()
V = 1
for i in range(int(N)):
    T = input()
    V = lcm(V, int(T))

print(V)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a, b):
      | ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define _abs(x)((x) < 0 ? (x) * -1 : (x))
#define _max(x, y)(max(0, max((x), (y))))
#define _min(x, y)(max(0, min((x), (y))))

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //freopen("debug.txt", "w", stderr);

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;

    cin >> n;

    vector<ll> odd;
    ll evenMax = 0;
    ll oddMax = 0;
    ll t;
    bool isNo = true;

    int i;

    for (i = 0; i < n; i++) {
        cin >> t;

        if (t % 2 == 0) {
            evenMax = max(evenMax, t);
        } else {
            odd.push_back(t);
            oddMax = max(oddMax, t);
        }
    }

    len = odd.size();

    if (0 < evenMax) {
        while (isNo) {
            isNo = false;

            for (i = 0; i < len; i++) {
                if (evenMax % odd[i] != 0) {
                    isNo = true;

                    break;
                }
            }

            if (isNo) evenMax += evenMax;
        }

        cout << evenMax << endl;
    } else {
        while (isNo) {
            isNo = false;

            for (i = 0; i < len; i++) {
                if (oddMax % odd[i] != 0) {
                    isNo = true;

                    break;
                }
            }

            if (isNo) oddMax += oddMax;
        }

        cout << oddMax << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: 'len' was not declared in this scope
   44 |     len = odd.size();
      |     ^~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <time.h>
#define int long long
#define US unsigned
using namespace std;
const double PI = acos(-1.0);

int max_n(int ary[], int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_o(int ary[], int length) {
	int max;
	max = max_n(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_n(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_o(int ary[], int length) {
	int min;
	min = min_n(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}

int gcm(int a, int b) {
	int result = a;
	int k = 0;
	int n = b;
	do {
		k = result % n;
		result = n;
		n = k;
	} while (k != 0);
	return result;
}

int gcm_n(int ary[], int length) {
	int g = ary[0];
	for (int i = 0; i < length; i++)
		g = gcm(g, ary[i]);
	return g;
}

int lcm(int a, int b) {
	int g, n;
	g = gcm(a, b);
	n = gcm(a, g);
	a = a / n;
	b = b / (g / n);
	return a*b;
}

int lcm_n(int ary[], int length) {
	int l = ary[0];
	for (int i = 0; i < length; i++)
		l = lcm(l, ary[i]);
	return l;
}

long main() {
	int n, t[100];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> t[i];
	cout << lcm_n(t, n) << endl;
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <time.h>
#define int long long
#define US unsigned
using namespace std;
const double PI = acos(-1.0);

int max_n(int ary[], int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_o(int ary[], int length) {
	int max;
	max = max_n(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_n(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_o(int ary[], int length) {
	int min;
	min = min_n(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}

int gcm(int a, int b) {
	int result = a;
	int k = 0;
	int n = b;
	do {
		k = result % n;
		result = n;
		n = k;
	} while (k != 0);
	return result;
}

int gcm_n(int ary[], int length) {
	int g = ary[0];
	for (int i = 0; i < length; i++)
		g = gcm(g, ary[i]);
	return g;
}

int lcm(int a, int b) {
	int g, n;
	g = gcm(a, b);
	n = gcm(a, g);
	a = a / n;
	b = b / (g / n);
	return a*b;
}

int lcm_n(int ary[], int length) {
	int l = ary[0];
	for (int i = 0; i < length; i++)
		l = lcm(l, ary[i]);
	return l;
}

short main() {
	int n, t[100];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> t[i];
	cout << lcm_n(t, n) << endl;
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef unsigned long long int ull;

ull gcd(ull a, ull b)
{
    if (b==0)
        return a;
    return gcd(b, a%b);
}
ull findlcm(ull arr[], ull n)
{
    ull ans = arr[0];
    for (int i=1; i<n; i++){
        ull g=gcd(arr[i], ans) ;
        ans = (arr[i]/g)*;

    }
    return ans;
}
int main()
{
    ull n,a[105],ans;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];

    ans=findlcm(a,n);
    cout<<ans<<endl;

    return 0;
}



Compiler output:
a.cc: In function 'ull findlcm(ull*, ull)':
a.cc:17:26: error: expected primary-expression before ';' token
   17 |         ans = (arr[i]/g)*;
      |                          ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <time.h>
#define int long long
#define US unsigned
using namespace std;
const double PI = acos(-1.0);

int max_n(int ary[], int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_o(int ary[], int length) {
	int max;
	max = max_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_n(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_o(int ary[], int length) {
	int min;
	min = min_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}

int gcm(int a, int b) {
	int result = a;
	int k = 0;
	int n = b;
	do {
		k = result % n;
		result = n;
		n = k;
	} while (k != 0);
	return result;
}

int gcm_n(int ary[], int length) {
	int g = ary[0];
	for (int i = 0; i < length; i++)
		g = gcm(g, ary[i]);
	return g;
}

int lcm(int a, int b) {
	int g, n;
	g = gcm(a, b);
	n = gcm(a, g);
	a = a / n;
	b = b / (g / n);
	return a*b;
}

int lcm_n(int ary[], int length) {
	int l = ary[0];
	for (int i = 0; i < length; i++)
		l = lcm(l, ary[i]);
	return l;
}

short main() {
	int n, t[100];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> t[i];
	cout << lcm_n(t, n) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int max_o(long long int*, long long int)':
a.cc:28:15: error: 'max_num' was not declared in this scope; did you mean 'max_n'?
   28 |         max = max_num(ary, length);
      |               ^~~~~~~
      |               max_n
a.cc: In function 'long long int min_o(long long int*, long long int)':
a.cc:44:15: error: 'min_num' was not declared in this scope; did you mean 'min_n'?
   44 |         min = min_num(ary, length);
      |               ^~~~~~~
      |               min_n
At global scope:
cc1plus: error: '::main' must return 'int'