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

int main(){
	int N, A[10];
	double M =1;
	scanf("%d", &N);
	if(N >= 2){
		for(int i = 0; i < N; i++){
		scanf("%d", &A[i]);
		M = M * A[i];
		printf("%.0lf", M);
		}
	}
	else{
		return 0;
	}	
	if(M < 0 || M > 10e18){
		printf("%d", -1);
	}
	else{
		printf("%.0lf", M);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d", &N);
      |         ^~~~~
a.cc:9:17: error: 'printf' was not declared in this scope
    9 |                 printf("%.0lf", M);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
a.cc:16:17: error: 'printf' was not declared in this scope
   16 |                 printf("%d", -1);
      |                 ^~~~~~
a.cc:16:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:19:17: error: 'printf' was not declared in this scope
   19 |                 printf("%.0lf", M);
      |                 ^~~~~~
a.cc:19:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <stdio.h>

int main() {
	long long int a, list[a+1],max = 1e18, result = 1, flag = 0, zero = 0;
	scanf("%lld", &a);
	for(int i = 0; i < a; i++){
		scanf("%lld", &list[i]);
		flag = (list[i] > max) ? 1 : flag;
		result *= list[i]
		(list[i]) ? max /= list[i] : zero = 1;
	}
	
	(zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", result)); 
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expression cannot be used as a function
    9 |                 result *= list[i]
      |                           ~~~~~~~
   10 |                 (list[i]) ? max /= list[i] : zero = 1;
      |                 ^~~~~~~~~
Language: C++

#include <stdio.h>

int main() {
	long long int a, list[a],max = 1e18, result = 1, flag = 0, zero = 0;
	scanf("%lld", &a);
	for(int i = 0; i < a; i++){
		scanf("%lld", &list[i]);
		flag = (list[i] > max) ? 1 : flag;
		result *= list[i]
		(list[i]) ? max /= list[i] : zero = 1;
	}
	
	(zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", result)); 
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expression cannot be used as a function
    9 |                 result *= list[i]
      |                           ~~~~~~~
   10 |                 (list[i]) ? max /= list[i] : zero = 1;
      |                 ^~~~~~~~~
Language: C++

#include <stdio.h>

int main() {
	unsigned long long int a, list[a],max = 1e18, result = 1, flag = 0, zero = 0;
	scanf("%llu", &a);
	for(int i = 0; i < a; i++){
		scanf("%llu", &list[i]);
		flag = (list[i] > max) ? 1 : flag;
		result *= list[i]
		(list[i]) ? max /= list[i] : zero = 1;
	}
	
	(zero) ? puts("0") : ((flag) ? puts("-1") : printf("%llu\n", result)); 
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expression cannot be used as a function
    9 |                 result *= list[i]
      |                           ~~~~~~~
   10 |                 (list[i]) ? max /= list[i] : zero = 1;
      |                 ^~~~~~~~~
Language: C

#include <stdio.h>

int main(){
	
	long long int t;
	scanf ("%lld",&t);
	long long int num[t]={0};
	long long int hasil = 1;
	for (long long int i=0;i<t;i++){
		scanf ("%lld",& num[i]);
	}
	for (long long int i=0;i<t;i++){
		
		
		if (num [i]==0){
			printf ("0\n");
			return 0;
		}
	}
	for (int i=0;i<t;i++){
		if (num[i]<=10e18/hasil){
			hasil = hasil * num[i];
		}
		else {
			printf ("-1\n");
			return 0;
		}
	}
	printf ("%lld",hasil);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:30: error: variable-sized object may not be initialized except with an empty initializer
    7 |         long long int num[t]={0};
      |                              ^
Language: C

#include <stdio.h>

int main(){
	
	long long int c;
	scanf ("%lld",&c);
	
	long long int num[c]={0};
	long long int sum=1;
	
	for (long long int i=0;i<c;i++){
		scanf ("%lld",&num[i]);
	}

	for (long long int i=0;i<c;i++){
		
		if (num[i]== 0){
			printf ("0\n");
			return 0;
           }
		}
		
	for (int i=0;i<c;i++){
		if(num[i]<=10e18/sum){
		sum = sum * num[i];
			}
			else{
			printf ("-1\n");
			}
		}
	printf ("%lld",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:30: error: variable-sized object may not be initialized except with an empty initializer
    8 |         long long int num[c]={0};
      |                              ^
Language: C

#include <stdio.h>

int main(){
	
	long long int c;
	scanf ("%d",&c);
	
	long long int num[c]={0};
	long long int sum=1;
	
	for (long long int i=0;i<c;i++){
		scanf ("%lld",&num[i]);
	}

	for (long long int i=0;i<c;i++){
		
		if (num[i]== 0){
			printf ("0\n");
           }
		}
		
	for (int i=0;i<c;i++){
		if(num[i]<=10e18/sum){
		sum = sum * num[i];
			}
			else{
			printf ("-1\n");
			}
		}
	printf ("%lld",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:30: error: variable-sized object may not be initialized except with an empty initializer
    8 |         long long int num[c]={0};
      |                              ^
Language: C++

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}
code wizardYesterday at 9:46 PM
// The input will contain 10 non-negative integers,
// each smaller than 1000, one per line.
#include <stdio.h>

int main()
{
  // 42 karena hasil angka % 42 sudah pasti < 42 alias 0 sampai 41
  // Kita ibaratkan 0 itu sebagai warna putih
  // dan > 0 itu adalah warna kuning
  int N, ctr[42] = {0}, unique = 0;
  // {0} ibaratnya mewarnai semua kolum dengan warna putih

  // loop sebanyak 10x untuk menerima 10 angka
  for (int i = 0; i < 10; i++)
  {
    scanf("%d", &N);
    int remainder = N % 42; // 3

    // Ctr di index remainder bertambah 1
    // Misal remainder adalah 1 artinya ctr[1]++;
    // Ibaratnya kita warnain column di index remainder dengan warna kuning
    ctr[remainder]++;
  }

  for (int i = 0; i < 42; i++)
  {
    // mengecek apakah ctr di index i TIDAK SAMA dengan 0
    // artinya pernah muncul minimal sekali
    // Ibaratnya menghitung jumlah kolum kuning
    if (ctr[i] != 0)
    {
      unique++;
    }
  }

  printf("%d\n", unique);

  return 0;
}

Compiler output:
a.cc:18:1: error: 'code' does not name a type
   18 | code wizardYesterday at 9:46 PM
      | ^~~~
Language: C++

#include <stdio.h>

int main(){
    
    int t,a[1100],sum;
    scanf("%d", &t);/5
    
    for(int i = 0; i < t; i++){
        scanf("%d", &a[i]);
    }
    
    for(int j = 0; j<t; j++){
        sum = 0;
        while(a[j] != 0){
            sum = sum + a[j]%10;//dapetin angka terakhir
            a[j] = a[j]/10;//ilangin angka terakhir
        }
        printf("%d\n", sum);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected primary-expression before '/' token
    6 |     scanf("%d", &t);/5
      |                     ^
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for(int i = 0; i < t; i++){
      |                    ^
Language: C

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}
	

Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:37: error: lvalue required as left operand of assignment
   10 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
main.c:13:12: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |            ^~~~
main.c:13:12: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:13:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |                                               ^~~~~~
main.c:13:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:47: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	long long int arr[n], max= 1e18, prod = 1, flag = 0, zero = 0;
	
	for (int i=0; i<n; i++)
	{
		scanf("%lld", &arr[i]);
		flag = (arr[i] > max) ? 1; flag;
		prod *= arr [i];
		(arr [i] ) ? max /= arr[i] ;zero =1;
	}
	(zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:42: error: expected ':' before ';' token
   11 |                 flag = (arr[i] > max) ? 1; flag;
      |                                          ^
      |                                          :
a.cc:11:42: error: expected primary-expression before ';' token
a.cc:13:43: error: expected ':' before ';' token
   13 |                 (arr [i] ) ? max /= arr[i] ;zero =1;
      |                                           ^~
      |                                           :
a.cc:13:44: error: expected primary-expression before ';' token
   13 |                 (arr [i] ) ? max /= arr[i] ;zero =1;
      |                                            ^
Language: C++


#include <iostream>
#include <vector>
#include <algorithm>

namespace ABC169
{

  class B
  {
  public:
    B() = default;
    ~B() = default;

    void Run()
    {
      int N;
      long long A[100001];
      std::cin >> N;

      bool over = false;
      long long accm = 1;
      for (int i = 0; i < N; ++i)
      {
        std::cin >> A[i];

        if (A[i] == 0)
        {
          over = false;
          accm = 0;
          break;
        }

        if (over) continue;

        int ten_count = 0;
        long long v = A[i];
        while (v >= 10)
        {
          v /= 10;
          ten_count++;
        }

        int accm_ten_count = 0;
        long long accm_v = accm;
        while (accm_v >= 10)
        {
          accm_v /= 10;
          accm_ten_count++;
        }

        if (ten_count + accm_ten_count > 18)
        {
          over = true;
        }

        accm *= A[i];
        over |= (accm > 1000000000000000000);
      }

      over |= (accm > 1000000000000000000);

      std::cout << (over ? -1 : accm) << std::endl;
    }
  };

}
int main()
{

  ABC169::C prob;
  prob.Run();

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:71:11: error: 'C' is not a member of 'ABC169'
   71 |   ABC169::C prob;
      |           ^
a.cc:72:3: error: 'prob' was not declared in this scope
   72 |   prob.Run();
      |   ^~~~
Language: C++

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

int main(){
    int c=0;
 	long long n,a,i,count=1,check=0;
  	cin >> n;
  	for(i=0;i<n;i++){
  	    cin >> a;
  	    if(a == 1000000000000000000) {
  	        check++;
  	        count = 0;
  	    }
  	    if(a==0) {
  	        check = 1000;
  	        count = 0;
  	        break;
  	    }
  	    count *= a;
  	}
  	if(check < 1000) cout << -1 << endl;
  	else if(count > 1000000000000000000) {
  	        cout << -1 << endl;
  	        c++;
  	        break;
  	}
    else if(c==0) cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: break statement not within loop or switch
   25 |                 break;
      |                 ^~~~~
Language: C++

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

int main(){
    int a=0;
 	long long n,a,i,count=1;
  	cin >> n;
  	for(i=0;i<n;i++){
  	    cin >> a;
  	    count *= a;
  	    if(count > 1000000000000000000) {
  	        cout << -1 << endl;
  	        a++;
  	    }
  	}
    if(a==0) cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: conflicting declaration 'long long int a'
    6 |         long long n,a,i,count=1;
      |                     ^
a.cc:5:9: note: previous declaration as 'int a'
    5 |     int a=0;
      |         ^
Language: C++

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

int main () {
  int N;
  cin >>N;
  vector<long long> A(N);

  long long ans,CheckNumber;
  ans = A.at(0);
  CheckNumber = 1e18;

  for(int i=0;i<N;i++){
    cin >>A.at(i);
    if (A.at(i) == 0){
      cout<<0<<endl;
      return 0;
    }else if (A.at(i) >= CheckNumber)
  }

  
  if(ans >= CheckNumber){ 
    cout<<-1<<endl;
    return 0;
  } else {
    for (int i=1;i<N;i++){
      ans = ans*A.at(i);
      if(ans >= CheckNumber){
        cout<<-1<<endl;
        return 0;
      }
    }
  }

  cout<<ans<<endl;
  
return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int ans=1LL;
  for(int i=0;i<n;i++){
    if(ans*a[i]<=1e18){
      ans*=a[i];
    }
    else{
      cout<<-1<<"\n";
      return;
    }
  }
  cout<<ans<<"\n";
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:18:7: error: return-statement with no value, in function returning 'int32_t' {aka 'int'} [-fpermissive]
   18 |       return;
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h?
#define int long long
using namespace std;
int32_t main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int ans=1LL;
  for(int i=0;i<n;i++){
    if(ans*a[i]<=1e18){
      ans*=a[i];
    }
    else{
      cout<<-1<<"\n";
      return;
    }
  }
  cout<<ans<<"\n";
}

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

#include<bits/stdc++.h>
#define endl "\n"
#define ll long long
#define eb emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define MA 1000000000000000000;
int va=10e8+7;
ll val[200007]={0};
using namespace std;
//Conditional Operator (condition?true part:false part) eg : cout<<(y<=3?"YES":"NO")<<endl;
//string s(3,'1');
// if number of elements in array >10^5 then declare global array.
ll getmul(ll n){ll int k{0};while(n>0){k+=n%10;n=n/10;}return k;}//Sum OF n DIGITS 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t{1};
   // cin>>t;
    while(t--){
        ll n;
        cin>>n;
        ll ans{1},flag{0};
        for(ll i=0;i<n;i++){
            ll x;
            cin>>x;
            if(flag==0) ans*=x;
            if(ans>MA){
                flag=1;
            }
        }
        if(flag) cout<<"-1"<<endl;
        else cout<<ans<<endl;
    }
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: expected primary-expression before ')' token
   28 |             if(ans>MA){
      |                      ^
Language: C++

#include<bits/stdc++.h>
#define endl "\n"
#define ll long long
#define eb emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define MA 10e+18
int va=10e8+7;
ll val[200007]={0};
using namespace std;
//Conditional Operator (condition?true part:false part) eg : cout<<(y<=3?"YES":"NO")<<endl;
//string s(3,'1');
// if number of elements in array >10^5 then declare global array.
ll getmul(ll n){ll int k{0};while(n>0){k+=n%10;n=n/10;}return k;}//Sum OF n DIGITS 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t{1};
   // cin>>t;
    while(t--){
        ll n;
        cin>>n;
        ll ans{1};
        for(ll i=0;i<n;i++){
            ll x;
            cin>>x;
            ans*=x;
            if(ans>MA){
                flag=1;
                break;
            }
        }
        if(flag) cout<<"-1"<<endl;
        else cout<<ans<<endl;
    }
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'flag' was not declared in this scope
   29 |                 flag=1;
      |                 ^~~~
a.cc:33:12: error: 'flag' was not declared in this scope
   33 |         if(flag) cout<<"-1"<<endl;
      |            ^~~~
Language: C

//squork
#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:37: error: lvalue required as left operand of assignment
   13 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}
l

Compiler output:
main.c: In function 'main':
main.c:12:37: error: lvalue required as left operand of assignment
   12 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
main.c: At top level:
main.c:18:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   18 | l
      | ^
Language: C

#include <stdio.h>

int main (){
	long long int a;
	scanf ("%lld",&a);
	
	long long int num [a]={0};
	long long int sum = 1;
	
	for (long long int i=0;i<a;i++){
		scanf ("%lld",&num[i]);
	}
	
	for (long long int i=0;i<a;i++){
		if (num[i]==0){
			printf ("0\n");
		}
	}
	
	for (int i=0;i<a;i++){
		if(num[i]<=1e18/sum){
			sum=sum * num[i];
		}
		else{
			printf("-1\n");
		}
	}
	
	printf ("%lld",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:31: error: variable-sized object may not be initialized except with an empty initializer
    7 |         long long int num [a]={0};
      |                               ^
Language: C++

#include <stdio.h>

int main(){
    long long int t;
    scanf("%lld",&t);
    long long int num[i]={0}; 
    long long int hasil=1;
    for (long long int i=0;i<n;i++){
        scanf("%lld",&num[i]); 
    }
    for(long long int i=0;i<n;i++){
    
        if (num[i]==0){
            printf("0\n");
            return 0;
        }
        }
    for (int i=0;i<n;i++){
        if(num[i]<=1000000000000000000/hasil){
            hasil*=num[i];
        }
        else{
            printf("-1\n");
            return 0;
        }
    }    
        printf("%lld",hasil);
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'i' was not declared in this scope
    6 |     long long int num[i]={0};
      |                       ^
a.cc:8:30: error: 'n' was not declared in this scope
    8 |     for (long long int i=0;i<n;i++){
      |                              ^
a.cc:9:23: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |         scanf("%lld",&num[i]);
      |                       ^~~
      |                       enum
a.cc:11:29: error: 'n' was not declared in this scope
   11 |     for(long long int i=0;i<n;i++){
      |                             ^
a.cc:13:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |         if (num[i]==0){
      |             ^~~
      |             enum
a.cc:18:20: error: 'n' was not declared in this scope
   18 |     for (int i=0;i<n;i++){
      |                    ^
a.cc:19:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |         if(num[i]<=1000000000000000000/hasil){
      |            ^~~
      |            enum
Language: C++

#include <stdio.h>

int main(){
    long long int t;
    scanf("%lld",&t);
    long long int num[n]={0}; 
    long long int hasil=1;
    for (long long int i=0;i<n;i++){
        scanf("%lld",&num[i]); 
    }
    for(long long int i=0;i<n;i++){
    
        if (num[i]==0){
            printf("0\n");
            return 0;
        }
        }
    for (int i=0;i<n;i++){
        if(num[i]<=1000000000000000000/hasil){
            hasil*=num[i];
        }
        else{
            printf("-1\n");
            return 0;
        }
    }    
        printf("%lld",hasil);
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'n' was not declared in this scope
    6 |     long long int num[n]={0};
      |                       ^
a.cc:9:23: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |         scanf("%lld",&num[i]);
      |                       ^~~
      |                       enum
a.cc:13:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |         if (num[i]==0){
      |             ^~~
      |             enum
a.cc:19:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |         if(num[i]<=1000000000000000000/hasil){
      |            ^~~
      |            enum
Language: C++

#include <stdio.h>
int main() {
  int N;
  scanf("%d", &N);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  for (int i = 0; i < N; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }
  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: 'n' was not declared in this scope
    5 |   long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
      |                     ^
a.cc:7:20: error: 'arr' was not declared in this scope
    7 |     scanf("%lld", &arr[i]);
      |                    ^~~
Language: C++

#include <stdio.h>
int main() {
  int j;
  scanf("%d", &j);
  long long int arr[j], max = 1e18, prod = 1, flag = 0, zero = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }
  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

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

#include <stdio.h>

int main() {
  int j;
  scanf("%d", &j);
  long long int arr[j], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < j; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:37: error: lvalue required as left operand of assignment
   12 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C

#include<stdio.h>
int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:37: error: lvalue required as left operand of assignment
   11 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C++

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'scanf' was not declared in this scope
    3 |   scanf("%d", &n);
      |   ^~~~~
a.cc:13:12: error: 'puts' was not declared in this scope
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |            ^~~~
a.cc:13:47: error: 'printf' was not declared in this scope
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |                                               ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
Language: C

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:37: error: lvalue required as left operand of assignment
   10 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
main.c:13:12: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |            ^~~~
main.c:13:12: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:13:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |                                               ^~~~~~
main.c:13:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:47: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:37: error: lvalue required as left operand of assignment
   10 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
main.c:13:12: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |            ^~~~
main.c:13:12: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:13:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
      |                                               ^~~~~~
main.c:13:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:47: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
int main () {
	long long int a, b, c = 1;
	scanf ("%lld", &a);

	long long 1int batas = 1000000000000000000;
	int flag = 0;
	for (long long int i = 0; i < a; i++) {
		scanf ("%lld", &b);
		if (c * b <= batas && flag == 0) {
			c *= b;
		} else {
			flag = 1;
		}
	}
	
	if (flag == 1) {
		c = -1;
	}
	if (a == 0) {
		c = 0;
	}
	
	printf ("%lld\n", c);
}

Compiler output:
main.c: In function 'main':
main.c:6:19: error: invalid suffix "int" on integer constant
    6 |         long long 1int batas = 1000000000000000000;
      |                   ^~~~
main.c:6:19: error: expected identifier or '(' before numeric constant
main.c:10:30: error: 'batas' undeclared (first use in this function)
   10 |                 if (c * b <= batas && flag == 0) {
      |                              ^~~~~
main.c:10:30: 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;
  for(i=0;i<=n;i++)
  {
    int a[n];
    cin>>a[n];
    int ans=1;
    ans*=a[n];
  }
  if(ans<pow(10,8)
     {
       cout<<"-1"<<endl;
       else
         cout<<ans<<endl;
     }
     return 0;
     }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0;i<=n;i++)
      |       ^
a.cc:13:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   if(ans<pow(10,8)
      |      ^~~
      |      abs
a.cc:13:10: error: 'pow' was not declared in this scope
   13 |   if(ans<pow(10,8)
      |          ^~~
a.cc:19:6: error: expected primary-expression before 'return'
   19 |      return 0;
      |      ^~~~~~
a.cc:18:7: error: expected ')' before 'return'
   18 |      }
      |       ^
      |       )
   19 |      return 0;
      |      ~~~~~~
a.cc:13:5: note: to match this '('
   13 |   if(ans<pow(10,8)
      |     ^
Language: C

#include <stdio.h>

int main(){
    int a;
    scanf("%d", &a);
    
    long long int b, c=1;
    for(i=0;i<a;i++){
        scanf("%lld", &b);
        c=c*b;
    }
    if(c>=1000000000000000000){
        c=-1;
    }
    printf ("%lld\n",c);
    return 0;
}

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

#include <stdio.h>

int main(){
    int a;
    scanf("%d", &a);
    
    long long int b, c=1;
    for(i=0;i<a;i++){
        scanf("%lld", &b);
        c=c*b;
    }
    if(c>=1000000000000000000){
        printf("%lld", c);
    }
    return 0;
}

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

#include<stdio.h>

int main(){
int N;

scanf ("%d",&N);
long long int A[N]{};
long long int B = 1;

for (int i = 0; i < N; i++ ){
scanf ("%lld",&A[i]);
}
for (int i = 0; i < N; i++ ){
	
if ( 10e18 / A[i] >= 1) {

B *= A[i];
}
}
if (B <= 10e8 && A!= 0) {
	printf ("%lld",B);
}
else {
	printf ("-1\n");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    7 | long long int A[N]{};
      |                   ^
main.c:11:16: error: 'A' undeclared (first use in this function)
   11 | scanf ("%lld",&A[i]);
      |                ^
main.c:11:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

def main ():
    N = int(input())
    A = list(map(int,input(). split ()))
    if 0 in A:
        print(0)
        return
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
    print(prod)
main ()

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

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
  double N ,i;
  cin>>N;
  int A[i];
  for (int i=0;i<N;i++)
    cout<<A[i];
  int ans=1;
  for(int i=0;i<=A[i];i++)
  {
    ans*=A[i];
  }
  if(ans>pow(10,18))
    cout<<"-1"<<endl;
  else 
    cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    9 |   int A[i];
      |         ^
a.cc:9:9: error: could not convert 'i' from 'double' to 'long unsigned int'
    9 |   int A[i];
      |         ^
      |         |
      |         double
a.cc:9:9: error: size of array 'A' has non-integral type 'double'
Language: C

#include <stdio.h>

int main(){
	long long int i,T=1,N,A[100001];
	scanf ("%lld",&N);
	for (i=0;i<N;i++){
		scanf ("%lld",&A[i]);
		if (A[i]==0){
			printf("0\n");
			return 0;
		}
	}
	for (i=0;i<N;i++){
		if (A[i] <= 1000000000000000000/T){
			T *= A[i];
		}
		else{
			printf ("-1\n");
			return 0;
		}
	}
	printf ("%lld\n",T);
	return 0;	

Compiler output:
main.c: In function 'main':
main.c:23:9: error: expected declaration or statement at end of input
   23 |         return 0;
      |         ^~~~~~
Language: C++

#include <stdio.h>
#include <math.h>
 
int main(void)
{
    int n=0,count=0;
    long int a[100000];
    for(int i=1;i<=100000;i++){
        a[i]=0;
    }
    long long ans=1;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%ld",&a[i]);
        if(a[i]==0){
            count+=1;
            break;
        }
    }
    if(count==1){
        printf("0");
        return 0;
    }
    for(int i=0;i<n;i++){
        if(ans<=(max/a[i])){
            ans*=a[i];
        } else {
            ans=-1;
            break;
        }
    }
    printf("%lld",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: 'max' was not declared in this scope; did you mean 'std::max'?
   25 |         if(ans<=(max/a[i])){
      |                  ^~~
      |                  std::max
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C

#include <stdio.h>
long long a [100010];
int main (){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%lld",&a[i]);
int zero =0;
9
for(int i=0;i<n;i++)if(a[i]==0) zero ++;
if(zero >0){
// a[i] contains 0
printf("0\n");
return 0;
}
long long prod =1;
for(int i=0;i<n;i++){
if(a[i ] <=1000000000000000000/ prod ){
// This condition is equivalent to prod*a[i] <=10ˆ18
prod *=a[i];
}else{
printf("-1\n");
return 0;
}
}
printf("%lld\n",prod );
}

Compiler output:
main.c: In function 'main':
main.c:8:2: error: expected ';' before 'for'
    8 | 9
      |  ^
      |  ;
    9 | for(int i=0;i<n;i++)if(a[i]==0) zero ++;
      | ~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int A[N];
  long long int ans =1;
  for(int i=0; i<N ; i++){
    cin >> A[i];
  }
  for(int i=0; i<N; i++){
    ans *=A[i];
  }
  if(ans >std::pow(10,18.0)){
    ans=-1;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'pow' is not a member of 'std'
   14 |   if(ans >std::pow(10,18.0)){
      |                ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int A[N];
  long long int ans =1;
  for(int i=0; i<N ; i++){
    cin >> A[i];
  }
  for(int i=0; i<N; i++){
    ans *=A[i];
  }
  if(ans >pow(10,18)){
    ans=-1
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'pow' was not declared in this scope
   14 |   if(ans >pow(10,18)){
      |           ^~~
a.cc:15:11: error: expected ';' before '}' token
   15 |     ans=-1
      |           ^
      |           ;
   16 |   }
      |   ~
Language: C++

#include<iostream>
#include<cmath>

int main()
{
    int N=0;
    std::cin >> N;
    double A[N];
    double result=1.0;
    max = std::pow(10.0,18.0)

    for(int i=0;i<N;i++)
    {
        std::cin >> A[i];
        result*=A[i];
    }
    if(result <= max)
    {
        std::cout << result:
        return 0;
    }
    std::cout << -1;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'max' was not declared in this scope; did you mean 'std::max'?
   10 |     max = std::pow(10.0,18.0)
      |     ^~~
      |     std::max
In file included from /usr/include/c++/14/string:51,
                 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:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:12:17: error: 'i' was not declared in this scope
   12 |     for(int i=0;i<N;i++)
      |                 ^
a.cc:19:28: error: expected ';' before ':' token
   19 |         std::cout << result:
      |                            ^
      |                            ;
Language: C

#include<stdio.h>
int main()
{
	long long n,input,max = 1e18,flag = 0,zero = 0,total = 1;
	scanf("%lld",&n);
	while(n--)
	{
		scanf("%lld",&input);
		flag = (input > max) ? 1 : flag;
		total *= input; 
		if(input == 0) zero = 1;
		else max /= input;
	}
	(zero == 1) ? printf("0\n") : (flag == 1) ? 
}

Compiler output:
main.c: In function 'main':
main.c:15:1: error: expected expression before '}' token
   15 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
	long long n,input,max = 1e18,flag = 0,total = 1,zero = 0;
	scanf("%lld",&n);
	while(n--)
	{
		scanf("%lld",&input);
		zero = (input == 0) ? 1 : zero;
		flag = (input > max) ? 1 : flag;
		total *= input;
		(input == 0) ? zero = 1 : max /= input;
	}
	(zero == 1) ? printf("0\n") : (flag == 1) ? printf("-1\n") : printf("%lld\n",total);
}

Compiler output:
main.c: In function 'main':
main.c:12:47: error: lvalue required as left operand of assignment
   12 |                 (input == 0) ? zero = 1 : max /= input;
      |                                               ^~
Language: C

#include<stdio.h>
int main()
{
	long long n,input,max = 1e18,flag = 0,total = 1,zero = 0;
	scanf("%lld",&n);
	while(n--)
	{
		scanf("%lld",&input);
		zero = (input == 0) ? 1 : zero;
		flag = (input > max) ? 1 : flag;
		total *= input;
		(input != 0) ? max /= input : zero = 1;
	}
	(zero == 1) ? printf("0\n") : (flag == 1) ? printf("-1\n") : printf("%lld\n",total);
}

Compiler output:
main.c: In function 'main':
main.c:12:52: error: lvalue required as left operand of assignment
   12 |                 (input != 0) ? max /= input : zero = 1;
      |                                                    ^
Language: C

#include<stdio.h>
int main()
{
	long long n,input,max = 1e18,flag = 0,total = 1,zero = 0;
	scanf("%lld",&n);
	while(n--)
	{
		scanf("%lld",&input);
		zero = (input == 0) ? 1 : zero;
		flag = (input > max) ? 1 : flag;
		total *= input;
		(input) ? max /= input : zero = 1;
	}
	(zero == 1) ? printf("0\n") : (flag == 1) ? printf("-1\n") : printf("%lld\n",total);
}

Compiler output:
main.c: In function 'main':
main.c:12:47: error: lvalue required as left operand of assignment
   12 |                 (input) ? max /= input : zero = 1;
      |                                               ^
Language: C++

#include <stdio.h> long long a[100010]; int main (){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%lld",&a[i]);
   int zero =0;
2
for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
// a[i] contains 0
printf("0\n");
return 0; }
long long prod =1; for(int i=0;i<n;i++){
if(a[i]<=1000000000000000000/prod){
// This condition is equivalent to prod*a[i]<=10ˆ18 prod*=a[i];
}else{ printf("-1\n");
return 0; }
}
printf("%lld\n",prod); }

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> long long a[100010]; int main (){
      |                    ^~~~
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 | scanf("%d",&n);
      |      ^
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      | ^~~
a.cc:4:13: error: 'i' does not name a type
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      |             ^
a.cc:4:17: error: 'i' does not name a type
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      |                 ^
a.cc:6:1: error: expected unqualified-id before numeric constant
    6 | 2
      | ^
a.cc:7:13: error: 'i' does not name a type
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |             ^
a.cc:7:17: error: 'i' does not name a type
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |                 ^
a.cc:7:40: error: expected unqualified-id before 'if'
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |                                        ^~
a.cc:11:20: error: expected unqualified-id before 'for'
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                    ^~~
a.cc:11:32: error: 'i' does not name a type
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                                ^
a.cc:11:36: error: 'i' does not name a type
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                                    ^
a.cc:17:7: error: expected constructor, destructor, or type conversion before '(' token
   17 | printf("%lld\n",prod); }
      |       ^
a.cc:17:24: error: expected declaration before '}' token
   17 | printf("%lld\n",prod); }
      |                        ^
Language: C

#include <stdio.h> long long a[100010]; int main (){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%lld",&a[i]);
   int zero =0;
2
for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
// a[i] contains 0
printf("0\n");
return 0; }
long long prod =1; for(int i=0;i<n;i++){
if(a[i]<=1000000000000000000/prod){
// This condition is equivalent to prod*a[i]<=10ˆ18 prod*=a[i];
}else{ printf("-1\n");
return 0; }
}
printf("%lld\n",prod); }

Compiler output:
main.c:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> long long a[100010]; int main (){
      |                    ^~~~
main.c:3:7: error: expected declaration specifiers or '...' before string constant
    3 | scanf("%d",&n);
      |       ^~~~
main.c:3:12: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d",&n);
      |            ^
main.c:4:1: error: expected identifier or '(' before 'for'
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      | ^~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      |              ^
main.c:4:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      |                  ^~
main.c:6:1: error: expected identifier or '(' before numeric constant
    6 | 2
      | ^
main.c:7:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |              ^
main.c:7:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |                  ^~
main.c:7:40: error: expected identifier or '(' before 'if'
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |                                        ^~
main.c:11:20: error: expected identifier or '(' before 'for'
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                    ^~~
main.c:11:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                                 ^
main.c:11:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                                     ^~
main.c:17:8: error: expected declaration specifiers or '...' before string constant
   17 | printf("%lld\n",prod); }
      |        ^~~~~~~~
main.c:17:17: error: expected declaration specifiers or '...' before 'prod'
   17 | printf("%lld\n",prod); }
      |                 ^~~~
main.c:17:24: error: expected identifier or '(' before '}' token
   17 | printf("%lld\n",prod); }
      |                        ^
Language: C++

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

#define print cout <<
#define printl(s) cout << s << endl;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;

const ll maxN = 1'000'000'000'000'000'000;


template <typename T>
vector<T> getValues(int num){
    vector<T> values(num);
    for(int i=0;i<num;i++){
        cin >> values.at(i);
    }
    return values;
}

ll culSum(vector<ll> inputs){
  ll ret = 1;
  rep(i,inputs.size()){
    it(inputs.at(i)==0){
      return 0;
    }
    if(inputs.at(i) <= maxN/ret){
        ret *= inputs.at(i);
    }else{
      return -1;
    }
  }
  return ret;
}

int main(){
    int N;
    cin >> N;
    auto inputs = getValues<ll>(N);
    printl(culSum(inputs));
}


Compiler output:
a.cc: In function 'll culSum(std::vector<long long int>)':
a.cc:24:5: error: 'it' was not declared in this scope; did you mean 'i'?
   24 |     it(inputs.at(i)==0){
      |     ^~
      |     i