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

#include <iostream>
#include <string>
#include <vector>
 
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
 
int main(){
  int n;
  cin >> n;
  vector<int> d(n);
  rep(i,n)cin >> d[i];
  int sum = 0;
  rep(i,n){
    for(int j=i+1;<n;j++){
      sum += d[i]* d[j];
    }
  }
  cout << sum << endl;
  return 0;
}

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

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

int main() {
  int N;
  cin >> N;
  vector<int> V(N);
  for (int i=0 ; i<N ; i++)
    cin >> V.at(i);
  int answer=0;
  for (int i=0 ; i<N ;i++){
    for (it j=0 ; j<N ;j++){
    if (i>j)
    continue;
  }
  }
 cout << answer << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'it' was not declared in this scope; did you mean 'i'?
   12 |     for (it j=0 ; j<N ;j++){
      |          ^~
      |          i
a.cc:12:19: error: 'j' was not declared in this scope
   12 |     for (it j=0 ; j<N ;j++){
      |                   ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> V(N);
  for (int i=0 ; i<N ; i++)
    cin >> V.at(i);
  int answer=0;
  for (int i=0 ; i<N ;i++){
    for (int j=0 ; j<N ; j++){
    if (i==J)
    continue;
    answer+=V.at(i)*V.at(j);
    }
  }
 cout << answer << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'J' was not declared in this scope
   13 |     if (i==J)
      |            ^
Language: C++

import java.util.*

fun main(args: Array<String>){
        val sc = Scanner(System.`in`)
        val n = sc.nextInt()
        val l = (1..n).map{sc.nextInt()}

        var ans = 0
        for(i in 0 until n){
                for(j in i+1 until n){
                        ans += l[i]*l[j]
                }
        }
        println(ans)
}

Compiler output:
a.cc:4:33: error: stray '`' in program
    4 |         val sc = Scanner(System.`in`)
      |                                 ^
a.cc:4:36: error: stray '`' in program
    4 |         val sc = Scanner(System.`in`)
      |                                    ^
a.cc:6:18: error: too many decimal points in number
    6 |         val l = (1..n).map{sc.nextInt()}
      |                  ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int sum = 0;
        int[] arr = new int[N];
        for (int i=0; i<N; i++) {
            arr[i] = sc.nextInt();
        }
        for (int i=0; i<N; i++) {
            for (int j=i+1; j<N; j++) {
                sum += arr[i]*arr[j];
            }
        }
        System.out.println(sum);
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int sum = 0;
        int[] arr = new int[N];
        for (int i=0; i<N; i++) {
            arr[i] = sc.nextInt();
        }
        for (int i=0; i<N; i++) {
            for (int j=i+1; j<N; j++) {
                sum += arr[i]*arr[j];
            }
        }
        System.out.println(sum);
    }
}


Compiler output:
Main.java:1: error: class test is public, should be declared in a file named test.java
public class test {
       ^
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class test
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class test
3 errors
Language: C++

#include<iostream>
using namespace std;
int N;
cin>>N;
int Heal[N];
for(int i=0;i<N;i++){
  cin>>Heal[i];
}
int healsum=0;
for(int i=0;i<N;i++){
  for(int j=i+1;j<N;j++){
         healsum=healsum+Heal[i]*Heal[j];
  }
}
cout<<healsum;
}

Compiler output:
a.cc:4:1: error: 'cin' does not name a type
    4 | cin>>N;
      | ^~~
a.cc:5:10: error: size of array 'Heal' is not an integral constant-expression
    5 | int Heal[N];
      |          ^
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for(int i=0;i<N;i++){
      | ^~~
a.cc:6:13: error: 'i' does not name a type
    6 | for(int i=0;i<N;i++){
      |             ^
a.cc:6:17: error: 'i' does not name a type
    6 | for(int i=0;i<N;i++){
      |                 ^
a.cc:10:1: error: expected unqualified-id before 'for'
   10 | for(int i=0;i<N;i++){
      | ^~~
a.cc:10:13: error: 'i' does not name a type
   10 | for(int i=0;i<N;i++){
      |             ^
a.cc:10:17: error: 'i' does not name a type
   10 | for(int i=0;i<N;i++){
      |                 ^
a.cc:15:1: error: 'cout' does not name a type
   15 | cout<<healsum;
      | ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C

#include <stdio.h>
#define M 100
#define N 50
int main(){
	int i,j;
	int str[M];
	scanf("%d",&i);
	for(j=0; j<i; j++){
		scanf("%d",&str[j]);3
	}
	int m,n,sum=0;
	for(m=0; m<i-1; m++){
		for(n=m+1; n<i; n++){
			sum+=str[m]*str[n];
		}
	}
	printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:9:38: error: expected ';' before '}' token
    9 |                 scanf("%d",&str[j]);3
      |                                      ^
      |                                      ;
   10 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int comb(int A,int N,int* d)
{
  int sum;
  for(int i = A + 1; i<N; i++){
    sum += d[A]*d[i];
  }
 return sum;
}
 
int main(void)
{
  int N;
  int i;
  cin >> N;
  
  int d[N];
  for(i=0;i<N;i++) {
    cin >> d[i];
  }
 
  int ans;
  for(i = 0;i<N;i++){
    ans += comb(i,N,&d);
  }
  return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: cannot convert 'int (*)[N]' to 'int*'
   26 |     ans += comb(i,N,&d);
      |                     ^~
      |                     |
      |                     int (*)[N]
a.cc:4:27: note:   initializing argument 3 of 'int comb(int, int, int*)'
    4 | int comb(int A,int N,int* d)
      |                      ~~~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int comb(int A,int N,int* data)
{
  int sum;
  for(int i = A + 1; i<N; i++){
    sum += data[A]*data[i];
  }
 return sum;
}
 
int main(void)
{
  int N;
  int i;
  cin >> N;
  
  int d[N];
  for(i=0;i<N;i++) {
    cin >> d[i];
  }
 
  int ans;
  for(i = 0;i<N;i++){
    ans += comb(i,N,*d);
  }
  return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   26 |     ans += comb(i,N,*d);
      |                     ^~
      |                     |
      |                     int
a.cc:4:27: note:   initializing argument 3 of 'int comb(int, int, int*)'
    4 | int comb(int A,int N,int* data)
      |                      ~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int comb(int A,int N,int* d)
{
  int sum;
  for(int i = A + 1; i<N; i++){
    sum += data[A]*data[i];
  }
 return sum;
}
 
int main(void)
{
  int N;
  int i;
  cin >> N;
  
  int d[N];
  for(i=0;i<N;i++) {
    cin >> d[i];
  }
 
  int ans;
  for(i = 0;i<N;i++){
    ans += comb(i,N,*d);
  }
  return ans;
}

Compiler output:
a.cc: In function 'int comb(int, int, int*)':
a.cc:8:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |     sum += data[A]*data[i];
      |                ^
a.cc:8:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |     sum += data[A]*data[i];
      |                        ^
a.cc: In function 'int main()':
a.cc:26:21: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   26 |     ans += comb(i,N,*d);
      |                     ^~
      |                     |
      |                     int
a.cc:4:27: note:   initializing argument 3 of 'int comb(int, int, int*)'
    4 | int comb(int A,int N,int* d)
      |                      ~~~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int comb(int A,int N,vevtor<int>& d)
{
  int sum;
  for(int i = A + 1; i<N; i++){
    sum += data[A]*data[i];
  }
 return sum;
}
 
int main(void)
{
  int N;
  int i;
  cin >> N;
  
  vector<int> d;
  for(i=0;i<N;i++) {
    cin >> d[i];
  }
 
  int ans;
  for(i = 0;i<N;i++){
    ans += comb(i,N,d);
  }
  return ans;
}

Compiler output:
a.cc:4:22: error: 'vevtor' has not been declared
    4 | int comb(int A,int N,vevtor<int>& d)
      |                      ^~~~~~
a.cc:4:28: error: expected ',' or '...' before '<' token
    4 | int comb(int A,int N,vevtor<int>& d)
      |                            ^
a.cc: In function 'int comb(int, int, int)':
a.cc:8:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |     sum += data[A]*data[i];
      |                ^
a.cc:8:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |     sum += data[A]*data[i];
      |                        ^
a.cc: In function 'int main()':
a.cc:26:21: error: cannot convert 'std::vector<int>' to 'int'
   26 |     ans += comb(i,N,d);
      |                     ^
      |                     |
      |                     std::vector<int>
a.cc:4:22: note:   initializing argument 3 of 'int comb(int, int, int)'
    4 | int comb(int A,int N,vevtor<int>& d)
      |                      ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int comb(int A,int N,int* data)
{
  int sum;
  for(int i = A + 1; i<N; i++){
    sum += data[A]*data[i];
  }
 return sum;
}
 
int main(void)
{
  int N;
  int i;
  cin >> N;
  
  vector<int> d;
  rep(i,N) {
    cin >> d[i];
  }
 
  int ans;
  for(i = 0;i<N;i++){
    ans += comb(i,N,d);
  }
  return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'rep' was not declared in this scope
   20 |   rep(i,N) {
      |   ^~~
a.cc:26:21: error: cannot convert 'std::vector<int>' to 'int*'
   26 |     ans += comb(i,N,d);
      |                     ^
      |                     |
      |                     std::vector<int>
a.cc:4:27: note:   initializing argument 3 of 'int comb(int, int, int*)'
    4 | int comb(int A,int N,int* data)
      |                      ~~~~~^~~~
Language: C++

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

int comb(int A,int N,int* data)
{
  for(int i = A + 1; i<N; i++){
    sum += data[A]*data[i];
  }
 return sum;
}

int main(void)
{
  int N;
  int i;
  cin >> N;
  
  vector<int> d;
  rep(i,N) {
    cin >> d[i];
  }

  int ans;
  for(i = 0;i<N;i++){
    ans += comb(i,N,d);
  }
  return ans;
}
    
  

Compiler output:
a.cc: In function 'int comb(int, int, int*)':
a.cc:7:5: error: 'sum' was not declared in this scope
    7 |     sum += data[A]*data[i];
      |     ^~~
a.cc:9:9: error: 'sum' was not declared in this scope
    9 |  return sum;
      |         ^~~
a.cc: In function 'int main()':
a.cc:19:3: error: 'rep' was not declared in this scope
   19 |   rep(i,N) {
      |   ^~~
a.cc:25:21: error: cannot convert 'std::vector<int>' to 'int*'
   25 |     ans += comb(i,N,d);
      |                     ^
      |                     |
      |                     std::vector<int>
a.cc:4:27: note:   initializing argument 3 of 'int comb(int, int, int*)'
    4 | int comb(int A,int N,int* data)
      |                      ~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) ll(x.size())
using namespace std;

int main() {
  ll n,ans;=0;
  cin >> n;
  vector<ll>d(n);
  rep(i,n) cin >> d.at(i);
  rep(i,n){
  	for(ll j=i+1; j<n; j++) ans+=d.at(i)*d.at(j);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected primary-expression before '=' token
    8 |   ll n,ans;=0;
      |            ^
Language: C++

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

int main(){
  int n;
  cin>> n;
  vector<int>d(n);
  rep(i, n) cin>> d[i];
  int sum=0;
  rep(j, n) rep(i, j){
    sum +=d[i]*d[j];
  }
  cout< sum<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |   cout< sum<< endl;
      |         ~~~^~~~~~~
Language: C++

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

int main(){
	int A,i,j,s=0;
	cin >> A;
	vector<int> tako(A);
	for ( i = 0; i < A; i++ ) {
		cin >> tako.at(i)
	}

    for(i=0;i<A;i++){
	    for(j=i+1;j<A;j++) s+=tako.at(i)+tako.at(j);
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: expected ';' before '}' token
    9 |                 cin >> tako.at(i)
      |                                  ^
      |                                  ;
   10 |         }
      |         ~
Language: C++

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

int main(){
	int A,i,j,s=0;
	cin >> A;
	vector<int> tako(A);
	for ( i = 0; i < A; i++ ) {
		cin >> tako.at(i)
	}

for(i=0;i<A;i++){
	for(j=i+1;j<A;j++) s+=tako.at(i)+tako.at(j);
}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: expected ';' before '}' token
    9 |                 cin >> tako.at(i)
      |                                  ^
      |                                  ;
   10 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl 	"\n"
 
typedef vector< ll > 	vi;
typedef vector< vi > 	vvi;
typedef pair< ll,ll > 	ii;
#define pb 		push_back
#define all(c) 		(c).begin(),(c).end()
#define tr(c,i) 	for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) 	((c).find(x) != (c).end())
 
#define MOD 	1000000007
#define INF 	(int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))
 
int main()
{	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	ll n;
 cin>>n;
 ll a[n];
 for(int i=0;i<n;i++)
 {
   cin>>a[i];
 }
 ll sum=0;
 for(int i=0;i<n;++)
 {
   for(int j=i+1;j<n;j++)
   {
     
     sum=a[i]*a[j];
   }
 }
 cout<<sum;
 return 0;
}
 
 

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

#include <iostream>
#include <vector>

int main(){
    int N, ans = 0;
    cin >> N;
    vector<int> d(N,0);
    for (int i = 0; i < N;i++)
        cin >> d[i];
    for (int i = 0; i < N-1;i++){
        for (int j = i + 1; j < N;j++){
            ans += d[i] * d[j];
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin >> N;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> d(N,0);
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> d(N,0);
      |            ^~~
a.cc:9:16: error: 'd' was not declared in this scope
    9 |         cin >> d[i];
      |                ^
a.cc:12:20: error: 'd' was not declared in this scope
   12 |             ans += d[i] * d[j];
      |                    ^
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout << ans << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |     cout << ans << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

    int sum = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            sum += d[i] * d[j];
        }
    }

    cout << sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'cin'
    7 |     cin >> n;
      |     ^~~
a.cc:9:16: error: 'd' was not declared in this scope
    9 |         cin >> d[i];
      |                ^
a.cc:15:20: error: 'd' was not declared in this scope
   15 |             sum += d[i] * d[j];
      |                    ^
Language: C++

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

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

    int sum = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            sum += d[i] * d[j]
        }
    }

    cout << sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'cin'
    7 |     cin >> n;
      |     ^~~
a.cc:9:16: error: 'd' was not declared in this scope
    9 |         cin >> d[i];
      |                ^
a.cc:15:20: error: 'd' was not declared in this scope
   15 |             sum += d[i] * d[j]
      |                    ^
Language: C++

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

int main(){
  int n, tmp, ans = 0;
  cin >> n;
  vector <int> l;
  for(int i = 0; i < n; ++i){
    cin >> tmp;
    l.push_back(tmp);
  }
  for(int i = 0; i < n - 1; ++i){
    for(int j = i+1; j < n; ++j{
      ans += l[i]*l[j];
    }
        }
        cout << ans << endl;
        return 0;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: expected ')' before '{' token
   14 |     for(int j = i+1; j < n; ++j{
      |        ~                       ^
      |                                )
Language: C++

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

int main(){
  int n, tmp, ans = 0;
  cin >> n;
  vector <int> l;
  for(int i = 0; i < n; ++i){
    cin >> tmp;
    l.push_buck(tmp);
  }
  for(int i = 0; i < n - 1; ++i){
    for(int j = i+1; j < n; ++j{
      ans += l[i]*l[j];
    }
        }
        cout << ans << endl;
        return 0;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'class std::vector<int>' has no member named 'push_buck'; did you mean 'push_back'?
   11 |     l.push_buck(tmp);
      |       ^~~~~~~~~
      |       push_back
a.cc:14:32: error: expected ')' before '{' token
   14 |     for(int j = i+1; j < n; ++j{
      |        ~                       ^
      |                                )
Language: C++

#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;

int main(){
	int n;
	int total = 0;
	cin >> n;
	vector<int> d(n);
	rep(i,n) cin >> d[i];
	rep(i,n)for(int j=i+1; j<n; j++) {
		total += d[i]*d[j];
	}
	
	cout << total << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         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 | #define rep(i,n) for(int i = 0; i < (n); ++i)
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int> d(n);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define rep(i,n) for(int i = 0; i < (n); ++i)
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> d(n);
      |                ^~~
a.cc:9:25: error: 'd' was not declared in this scope
    9 |         rep(i,n) cin >> d[i];
      |                         ^
a.cc:11:26: error: 'd' was not declared in this scope
   11 |                 total += d[i]*d[j];
      |                          ^
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << total << endl;
      |         ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |         cout << total << endl;
      |                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define rep(i,n) for(int i = 0; i < (n); ++i)
Language: C++

#include <iostream>
using namespace std;
int main()
{
 int n,d;
  cin>>n;
  int d[50];
  int i;
  i=0;
  while(i<n)
  {
    cin>>d[i];
    i++;
  }
  int ans=0;
  int ii;
  i=0;
  while(i<n)
  {
    ii=i+1;
   while(ii<n) 
   {
     ans+=d[i]*d[ii]
       ii++;
   }
    i++;
  }
  
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: conflicting declaration 'int d [50]'
    7 |   int d[50];
      |       ^
a.cc:5:8: note: previous declaration as 'int d'
    5 |  int n,d;
      |        ^
a.cc:12:11: error: invalid types 'int[int]' for array subscript
   12 |     cin>>d[i];
      |           ^
a.cc:23:12: error: invalid types 'int[int]' for array subscript
   23 |      ans+=d[i]*d[ii]
      |            ^
a.cc:23:17: error: invalid types 'int[int]' for array subscript
   23 |      ans+=d[i]*d[ii]
      |                 ^
Language: C++

#include<stdio.h>
nt main(void)
{
	int N = 0, i = 0, j = 0, sum = 0;
	int a[55] = { 0 };
	scanf("%d", &N);
	for (i = 0; i < N; i++)
	scanf("%d", &a[i]);
	for (i = 0; i < N; i++)
	{		
		for (j = i + 1; j < N; j++)
		{
			sum += a[i] * a[j];
		}
	}
	printf("%d\n", sum);
	return 0;
}

Compiler output:
a.cc:2:1: error: 'nt' does not name a type; did you mean 'int'?
    2 | nt main(void)
      | ^~
      | int
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:37: error: 'a' was not declared in this scope
    7 |   for(int i = 0; i < n; i++) cin >> a[i];
      |                                     ^
Language: Java

import java.util.*;

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

Compiler output:
Main.java:18: error: <identifier> expected
  System.out.println(sum);
                    ^
Main.java:18: error: <identifier> expected
  System.out.println(sum);
                        ^
2 errors
Language: C

#include<stdio.h>

int main()
{

  int a, c=0;/*たこ焼きの数・美味しさ値総量*/
  int b[101];/*たこ焼きの美味しさデータ*/
  
  scanf("%d", &a);
  
  for(i=0; i<a; i++)
  {
      scanf("%d", b[i]);
  }
  
  for(i=0; i<a; i++)
  {
  	for(j=i+1; j<a; j++)
    {
    	c += b[i]*b[j];
    }
  }
  
 printf("%d", c);
  return 0;
}

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

#include<stdio.h>

int main()
{

  int a, b=0;/*たこ焼きの数・美味しさ値総量*/
  int b[101];/*たこ焼きの美味しさデータ*/
  
  scanf("%d", &a);
  
  for(i=0, i<a, i++)
  {
      scanf("%d", b[i]);
  }
  
  for(i=0, i<a, i++)
  {
  	for(j=i+1, j<a, j++)
    {
    	c += b[i]*b[j];
    }
  }
  
 printf("%d", c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:7: error: conflicting types for 'b'; have 'int[101]'
    7 |   int b[101];/*たこ焼きの美味しさデータ*/
      |       ^
main.c:6:10: note: previous definition of 'b' with type 'int'
    6 |   int a, b=0;/*たこ焼きの数・美味しさ値総量*/
      |          ^
main.c:11:7: error: 'i' undeclared (first use in this function)
   11 |   for(i=0, i<a, i++)
      |       ^
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:20: error: expected ';' before ')' token
   11 |   for(i=0, i<a, i++)
      |                    ^
      |                    ;
main.c:11:20: error: expected expression before ')' token
main.c:16:20: error: expected ';' before ')' token
   16 |   for(i=0, i<a, i++)
      |                    ^
      |                    ;
main.c:16:20: error: expected expression before ')' token
main.c:18:13: error: 'j' undeclared (first use in this function)
   18 |         for(j=i+1, j<a, j++)
      |             ^
main.c:18:28: error: expected ';' before ')' token
   18 |         for(j=i+1, j<a, j++)
      |                            ^
      |                            ;
main.c:18:28: error: expected expression before ')' token
main.c:20:9: error: 'c' undeclared (first use in this function)
   20 |         c += b[i]*b[j];
      |         ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  int ans = 0;
  vector<int> tako(n);
  for(int i=0; i<n; i++){
    cin >> tmp;
    tako.at(i) = tmp;
  }
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
      ans += tako.at(i)*tako.at(j);
    }
    ans -= tako.at(i)*tako.at(i);
  }
  cout << ans/2 << endl;
}
    

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

#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  int a[50];
  int sum = 0;
  for(int i = 0;i < n;i++)
  {
    scanf("%d",&a[i]);
  }
  for(int i=0;i < n-1;i++)
  {
    for(int j=i+1; j<n;j++)
    {
      sum += a[i] + a[j];
    }
  }
  printf("%d\n",sum)
}

Compiler output:
main.c: In function 'main':
main.c:18:21: error: expected ';' before '}' token
   18 |   printf("%d\n",sum)
      |                     ^
      |                     ;
   19 | }
      | ~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
typedef long long ll;

using namespace std;

int main() {
   int n,d[n]; 
   cin >> n;
   rep(i,n)
   cin >> d[i];
   int ans=0;
   rep(i,n){
      for(int j=i+1; j<n; j++){
      ans+=d[i]*d[j];
      }
      cout << ans << endl;
   }

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

import java.util*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int d[] = new int[n];
    int heal = 0;
    for(int i = 0; i < n; i++){
      d[i] = sc.nextInt();
    }
    for(int i = 0; i < n - 1; i++){
      for(int j = i + 1; j < n; j++){
        heal += d[i] * d[j];
      }
    }
    System.out.println(heal);
  }
}
      

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

#include<string>
using namespace std;
int n,m;
int a[105];
int sum;
int main(){
    cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		m+=a[i];}
	for(int i=0;i<n;i++){
		sum+=a[i]*(m-a[i]);
	};
	cout<<sum/2<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout<<sum/2<<endl;
      |         ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:22: error: 'endl' was not declared in this scope
   14 |         cout<<sum/2<<endl;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<string>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: Java

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


Compiler output:
Main.java:7: error: cannot find symbol
    for(i=0; i < n; i++) {
        ^
  symbol:   variable i
  location: class Main
Main.java:7: error: cannot find symbol
    for(i=0; i < n; i++) {
             ^
  symbol:   variable i
  location: class Main
Main.java:7: error: cannot find symbol
    for(i=0; i < n; i++) {
                    ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
      a[i] = sc.nextInt();
        ^
  symbol:   variable i
  location: class Main
4 errors
Language: Java

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


Compiler output:
Main.java:8: error: variable a might not have been initialized
      a[i] = sc.nextInt();
      ^
Main.java:13: error: variable a might not have been initialized
      S1 += a[i]*a[i];
            ^
Main.java:16: error: variable a might not have been initialized
      S2 += a[i];
            ^
3 errors
Language: Java

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

Compiler output:
Main.java:7: error: cannot find symbol
    for(i=0; i < n; i++) {
        ^
  symbol:   variable i
  location: class Main
Main.java:7: error: cannot find symbol
    for(i=0; i < n; i++) {
             ^
  symbol:   variable i
  location: class Main
Main.java:7: error: cannot find symbol
    for(i=0; i < n; i++) {
                    ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
      a[i] = sc.nextInt();
        ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
    for(i=0; i < n; i++) {
        ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
    for(i=0; i < n; i++) {
             ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
    for(i=0; i < n; i++) {
                    ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
      S1 += a[i]*a[i];
              ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
      S1 += a[i]*a[i];
                   ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
    for(i=0; i< n;i++) {
        ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
    for(i=0; i< n;i++) {
             ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
    for(i=0; i< n;i++) {
                  ^
  symbol:   variable i
  location: class Main
Main.java:16: error: cannot find symbol
      S2 += a[i];
              ^
  symbol:   variable i
  location: class Main
13 errors
Language: C++

#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7;

signed main()
{
	IO_OP;
	
	int n, s = 0;
	cin >> n;
	for(int i=0;i<n;i++) cin >> a[i];
	for(int i=0;i<n;i++)
		for(int j=0;j<i;j++)
			s += a[i] * a[j];
	cout << s << endl;
	
}






Compiler output:
a.cc: In function 'int main()':
a.cc:26:37: error: 'a' was not declared in this scope
   26 |         for(int i=0;i<n;i++) cin >> a[i];
      |                                     ^
a.cc:29:30: error: 'a' was not declared in this scope
   29 |                         s += a[i] * a[j];
      |                              ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <stdio.h>

#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
using namespace std;

int main(){
    int n; cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d[i];
    
    int ans = 0;
    for (int i = 0; i<n; i++ ) {
        for (int j = i+1; j<n; j++) {
            ans += d[i]*d[j];
        }
    }
    cout << ans << endl'
    

}


Compiler output:
a.cc:26:24: warning: missing terminating ' character
   26 |     cout << ans << endl'
      |                        ^
a.cc:26:24: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:26:24: error: expected ';' before '}' token
   26 |     cout << ans << endl'
      |                        ^
      |                        ;
......
   29 | }
      | ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'll' was not declared in this scope
   11 |   ll sum = 0 ;
      |   ^~
a.cc:16:7: error: 'sum' was not declared in this scope
   16 |       sum += d[i] * d[j] ;
      |       ^~~
a.cc:19:11: error: 'sum' was not declared in this scope
   19 |   cout << sum << endl ;
      |           ^~~
Language: C++

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std ;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n ;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   cout << sum << endl ;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   cout << sum << endl ;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<cstdio>
#include<iostream>
using namespace std;
int main(){ int n,a[10001],ans = 0; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) ans+=a[i]*a[j]; cout<<ans; }          }

Compiler output:
a.cc:4:162: error: expected declaration before '}' token
    4 | int main(){ int n,a[10001],ans = 0; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) ans+=a[i]*a[j]; cout<<ans; }          }
      |                                                                                                                                                                  ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main(){
  int sum,sumsum,n;
  cin >> n;
  for(int i=0,i<=n,i++){
    int d;
    cin >> d;
    sum = sum + d;
    sumsum=sumsum +d*d;
  }
  cout << (sum*sum-sumsum)/2 << endl;
  return 0;
}

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

#include<stdio.h>
int main(void){
  int n,i,a[51],f;
  scanf("%d",&n);
  f=0;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      f=f+a[i]*a[j];
    }
  }
  printf("%d\n",f);
  return 0;
}

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

int main(){
  int N;
  cin>>N;
  vector<int> d(N);
  
  for(int i=0;i<N;++i){
    cin>>d.at(i);
  }

  int sum=0;
  for(int i=0;i<N;++i){
    for(int j=0;j<N;++j){
      if(j==i){
        continue;
      }
      else{
        sum=sum+d.at(i)*d.at(j);
      }
    }
  }
  cout<<sum/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>N;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int> d(N);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> d(N);
      |          ^~~
a.cc:7:10: error: 'd' was not declared in this scope
    7 |     cin>>d.at(i);
      |          ^
a.cc:17:17: error: 'd' was not declared in this scope
   17 |         sum=sum+d.at(i)*d.at(j);
      |                 ^
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout<<sum/2<<endl;
      |   ^~~~
a.cc:21:16: error: 'endl' was not declared in this scope
   21 |   cout<<sum/2<<endl;
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=109;

int main()
{
    ios::sync_with_stdio(false);
    cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            ans+=a[i]*a[j];
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope
    8 |     cin>>n;
      |          ^
a.cc:10:31: error: 'a' was not declared in this scope
   10 |     for(int i=1;i<=n;i++)cin>>a[i];
      |                               ^
a.cc:13:18: error: 'a' was not declared in this scope
   13 |             ans+=a[i]*a[j];
      |                  ^
Language: Java

public static void main(String[] args)
    {
        Scanner in1 = new Scanner(System.in);
        int N = in1.nextInt();
        int D[]=new int [N];
        Scanner d = new Scanner(System.in);
        int sum=0;
        for (int x=0;x<N;x++)
        {
            D[x]=d.nextInt();
        }
        for (int y=0;y<N-1;y++)
        {
            for (int x=y+1;x<N;x++)
            {
                sum+=D[x]*D[y];
            }
        }
        System.out.print(sum);
    }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args)
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.Scanner;

public class Test
{
    public static void main(String[] args)
    {
        Scanner in1 = new Scanner(System.in);
        int N = in1.nextInt();
        int D[]=new int [N];
        Scanner d = new Scanner(System.in);
        int sum=0;
        for (int x=0;x<N;x++)
        {
            D[x]=d.nextInt();
        }
        for (int y=0;y<N-1;y++)
        {
            for (int x=y+1;x<N;x++)
            {
                sum+=D[x]*D[y];
            }
        }
        System.out.print(sum);
    }
}

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

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

int main(){
  int N
  int d[N];
  int i,j;
  int ans=0;
  cin >> N;
  for(i=0;i<N;++i){
    cin >> d[i];
  }

  for(i=0;i<N;++i){
    for(j=i+1;j<N;j++){
        ans += d[i] * d[j];
    }
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int d[N];
      |   ^~~
a.cc:9:10: error: 'N' was not declared in this scope
    9 |   cin >> N;
      |          ^
a.cc:11:12: error: 'd' was not declared in this scope
   11 |     cin >> d[i];
      |            ^
a.cc:16:16: error: 'd' was not declared in this scope
   16 |         ans += d[i] * d[j];
      |                ^
Language: C++

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

int main(){

int N;
int d[N];
int i,j,k,x,y;
int ans=0;

cin >> N;

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

for(j=0;j<N;j++){
  x = d[j];
  for(k=0;k<N;k++){
  y = d[k];
  if(j=!k){
    ans += x * y;
  }
  }
}


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

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

int main() {
    int n;
    cin >> a;
    vector<int> d(n);
    for (auto &e: d) cin >> e;
    
    int ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j < n; j++) {
            ans += d[i] * d[j];
        }
    }
    
    cout << ans << endl;
    
    return 0;
}


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

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n; cin>>n;
	vi d(n);
	rep(i, n) cin>>d[i];

	ll ans=0;
	rep(i, n)rep(j, n){
		if (i!=k){
			ans += d[i]*d[j];
		}
	}
	cout << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:24: error: 'k' was not declared in this scope
   35 |                 if (i!=k){
      |                        ^
Language: C++

#include<stdio.h>
int main()
{
	int n,d[50],i,j,x;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&d[i]);
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if(d[i]*d[j])
				x+=d[i]*d[j];
			}
		}
	}
	printf("%d\n",x);
	return 0;
}


Compiler output:
a.cc:16:15: error: expected constructor, destructor, or type conversion before '(' token
   16 |         printf("%d\n",x);
      |               ^
a.cc:17:9: error: expected unqualified-id before 'return'
   17 |         return 0;
      |         ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: Java

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

public class Main {
  public static void main(String [] args) {
    FastReader fr = new FastReader();
    int N = fr.nextInt();
    int[] d = new int[N];
    int sum = 0;
    int power = 0;
    for (int i = 0; i < N; i++) {
      d[i] = fr.nextInt();
      sum += d[i];
      power += d[i] * d[i];
    }
    
    return sum * sum - power;
  }
}

class FastReader {
  BufferedReader br;
  StringTokenizer st;

  public FastReader() {
    br = new BufferedReader(new
        InputStreamReader(System.in));
  }

  String next() {
    while (st == null || !st.hasMoreElements())
    {
      try
      {
        st = new StringTokenizer(br.readLine());
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    return st.nextToken();
  }

  int nextInt() {
    return Integer.parseInt(next());
  }

  long nextLong() {
    return Long.parseLong(next());
  }

  double nextDouble() {
    return Double.parseDouble(next());
  }

  String nextLine() {
    String str = "";
    try {
      str = br.readLine();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
    return str;
  }
}

Compiler output:
Main.java:19: error: incompatible types: unexpected return value
    return sum * sum - power;
                     ^
1 error
Language: C

#include<stdio.h>
int main(void){
  double a,b;
  int i,j;
  b=0;
  scanf("%d",&a);
  double d[a];
  for(i=0;i<a;i++){scanf("%lf",&d[i]);}
  for(i=0;i<a;i++){
    for(j=0;j<a;j++){
      if(i==j){b+=d[i]*d[j];}
      else{b+=(d[i]*d[j])/2;}
    }
  }
  printf("%d",b);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:10: error: size of array 'd' has non-integer type
    7 |   double d[a];
      |          ^