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

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

int main() {
int n;
cin >> n;
vector<int> d(n);
for(inti=0;i<n;i++)cin>>d[i];
int ans=0;
for(inti=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:8:5: error: 'inti' was not declared in this scope; did you mean 'int'?
    8 | for(inti=0;i<n;i++)cin>>d[i];
      |     ^~~~
      |     int
a.cc:8:12: error: 'i' was not declared in this scope
    8 | for(inti=0;i<n;i++)cin>>d[i];
      |            ^
a.cc:10:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   10 | for(inti=0;i<n;i++){
      |     ^~~~
      |     int
a.cc:10:12: error: 'i' was not declared in this scope
   10 | for(inti=0;i<n;i++){
      |            ^
Language: C++

#include "stdafx.h" //プリインクルードされている場合はコメントアウト
#include <iostream>
#include <string>
#include <cstdlib> //func147bでインクルード
#include <vector>  //func146b
using namespace std;


void func143b()
{
    int n,s;
    
    int healamount = 0;
    vector<int> v;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
         v.emplace_back(s);
    }
    for (int i = 0; i < n-1; ++i) {
        for (int j = i +1 ; j < n; ++j) {
            healamount += v[i] * v[j];
        }
    }
    cout << healamount << endl;
}
int main()
{
  func144b();
  return 0;
}
    

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h" //プリインクルードされている場合はコメントアウト
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


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


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'a' was not declared in this scope
    9 |                 ans+=a[i]*a[j];
      |                      ^
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[] delicious = new int[n];
    int s = 0;
    int ss = 0;
    for(int i = 0; i < n; i++){
      delicious[i] = sc.nextInt();
      s += delicious[i];
      ss += delicious[i] * delicious[i];
    }
    System.out.println((s * s - ss) / 2)
  }
}

Compiler output:
Main.java:14: error: ';' expected
    System.out.println((s * s - ss) / 2)
                                        ^
1 error
Language: C++

#include<iostream>
#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] ;

   int sum = 0 ;
   for(int i=0;i<N-1;i++){
     sum+=d[i]*d[i+1] ;
   }
   sum+=d[0]*d[N-1]
  
  cout << sum << endl;
     
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before 'cout'
   15 |    sum+=d[0]*d[N-1]
      |                    ^
      |                    ;
   16 | 
   17 |   cout << sum << endl;
      |   ~~~~
Language: C++

#include<iostream>
#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] ;

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

  cout << sum+(d[0]*d[n-1]) << endl;
     
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'n' was not declared in this scope
   16 |   cout << sum+(d[0]*d[n-1]) << endl;
      |                       ^
Language: C++

#include<iostream>
#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] ;

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

  cout << sum+(d[0]*d[n-1]) << endl;
     
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope
    8 |    int d[n];
      |          ^
a.cc:9:31: error: 'd' was not declared in this scope
    9 |    for(int i=0;i<N;i++)cin >> d[i] ;
      |                               ^
a.cc:13:11: error: 'd' was not declared in this scope
   13 |      sum+=d[i]*d[i+1] ;
      |           ^
a.cc:16:16: error: 'd' was not declared in this scope
   16 |   cout << sum+(d[0]*d[n-1]) << endl;
      |                ^
Language: C++

#include<iostream>
#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] ;

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

  cout << sum+(d[0]*d[n-1]) << endl;
     
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope
    8 |    int d[n];
      |          ^
a.cc:9:31: error: 'd' was not declared in this scope
    9 |    for(int i=0;i<N;i++)cin >> d[i] ;
      |                               ^
a.cc:13:11: error: 'd' was not declared in this scope
   13 |      sum+=d[i]*d[i+1]
      |           ^
a.cc:16:16: error: 'd' was not declared in this scope
   16 |   cout << sum+(d[0]*d[n-1]) << endl;
      |                ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;

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

Compiler output:
a.cc:23:27: error: macro "rep" passed 3 arguments, but takes just 2
   23 |     rep(i,n-1) rep(j,i+1,n) {
      |                           ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,n) for (int i = 0; i < n; ++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:23:16: error: 'rep' was not declared in this scope
   23 |     rep(i,n-1) rep(j,i+1,n) {
      |                ^~~
Language: C++

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

void func143b() {
  int n, d[50] = {};
  int i, j, x, y, cnt = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> d[i];
  for (i = 1; i < n; i++) {
    x = d[i];
    //cout << "takoyaki_" << i << ": " << x << endl;
    for (j = i + 1; j <= n; j++) {
      y = d[j];
      cnt += x * y;
      //cout << "takoyaki_" << j << ": " << y << endl;
      //cout << "x * y: " << x * y << endl;
      //cout << "cnt: " << cnt << endl;
    }
  }
  cout << cnt;
}

int main() {
  func140b();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'func140b' was not declared in this scope; did you mean 'func143b'?
   25 |   func140b();
      |   ^~~~~~~~
      |   func143b
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    int s;
    cin>>n;
    vector<int> A(n);
    for(int i = 0; i < n; i++) {
        cin>>A.at(i);
    }
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            if (i!=j){}
            s+=A.at(i)*A.at(j);
        }           
            /* code    */
            }   
    }

    cout << s << endl;

    return 0;
}

Compiler output:
a.cc:22:5: error: 'cout' does not name a type
   22 |     cout << s << endl;
      |     ^~~~
a.cc:24:5: error: expected unqualified-id before 'return'
   24 |     return 0;
      |     ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    int s;
    cin>>n;
    vector<int> A(n);
    for(int i = 0; i < n; i++) {
        cin>>A.at(i)
    }
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            s+=A.at(i)*A.at(j)
            /* code */
        }
    }

    cout << s << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ';' before '}' token
   11 |         cin>>A.at(i)
      |                     ^
      |                     ;
   12 |     }
      |     ~                
a.cc:15:31: error: expected ';' before '}' token
   15 |             s+=A.at(i)*A.at(j)
      |                               ^
      |                               ;
   16 |             /* code */
   17 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    int s;
    cin>>n;
    vector<int> A(N);
    for(int i = 0; i < n; i++) {
        cin>>A.at(i)
    }
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            s+=A.at(i)*A.at(j)
            /* code */
        }
    }

    cout << s << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'N' was not declared in this scope
    9 |     vector<int> A(N);
      |                   ^
a.cc:11:21: error: expected ';' before '}' token
   11 |         cin>>A.at(i)
      |                     ^
      |                     ;
   12 |     }
      |     ~                
a.cc:15:31: error: expected ';' before '}' token
   15 |             s+=A.at(i)*A.at(j)
      |                               ^
      |                               ;
   16 |             /* code */
   17 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;cin>>n;
  vector<int> A(n);
  for(int i = 0; n > i; i++){
    cin>>A[i];
  }
  int ans = 0;
  for(int i = 0; n > i; i++){
    for(int j = 0; n > j; j++){
      if(i==j)continue;
      ans += A[i]*A[j];
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> A(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> A(n);
      |          ^~~
a.cc:7:10: error: 'A' was not declared in this scope
    7 |     cin>>A[i];
      |          ^
a.cc:13:14: error: 'A' was not declared in this scope
   13 |       ans += A[i]*A[j];
      |              ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n){
     cin >> a.at(i);
  }
  int sum=0;
  rep(i, n){
    rep(j, n){
      sum += a.at(i) + a.at(j)
    }
  }
  rep(i, n){
    sum -= a.at(i) * 2;
  }
  cout << sum/2 << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before '}' token
   16 |       sum += a.at(i) + a.at(j)
      |                               ^
      |                               ;
   17 |     }
      |     ~
Language: C++

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

int main(){

  int N=0;
  cin>>N;

  int A[N];

  rep(i,N){
	cin>>A[i];
  }
  
  
  int sum=0;
  rep(i,N){

    for(int j=i+1;j<N;j++;){
	
      sum+=A[i]*A[j];

    }
    
  }
  cout<<sum;
  
}


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

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

int main(){

  int N=0;
  cin>>N;

  int A[N];

  rep(i,N){
	cin>>A[i];
  }
  
  
  int sum=0;
  rep(i,N){

    for(j=i+1;j<N;j++;){
	
      sum+=A[i]*A[j];

    }
    
  }
  cout<<sum;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'j' was not declared in this scope
   22 |     for(j=i+1;j<N;j++;){
      |         ^
a.cc:22:22: error: expected ')' before ';' token
   22 |     for(j=i+1;j<N;j++;){
      |        ~             ^
      |                      )
a.cc:22:23: error: expected primary-expression before ')' token
   22 |     for(j=i+1;j<N;j++;){
      |                       ^
Language: C++

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

int main(){

  int N=0;
  cin>>N;

  int A[N];

  rep(i,N){
	cin>>A[i];
  }
  
  
  int sum=0;
  rep(i,N){

    for(j=i+1,j<N;j++){
	
      sum+=A[i]*A[j];

    }
    
  }
  cout<<sum;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'j' was not declared in this scope
   22 |     for(j=i+1,j<N;j++){
      |         ^
a.cc:22:22: error: expected ';' before ')' token
   22 |     for(j=i+1,j<N;j++){
      |                      ^
      |                      ;
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: expected ';' before '}' token
   15 |                         sum += (i*j)
      |                                     ^
      |                                     ;
   16 |                 }
      |                 ~
Language: C++

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

//テストケースはあんまり見ないほうが良い。デバッグする能力が必要.
int main(){
    int n;
    vector<int> d;
    rep(i,n)cin >> d[i];
    int ans=0;
    rep(i,n-1){
        for(int j=i;j<n;j++){
            ans += d[i]*d[j]
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected ';' before '}' token
   14 |             ans += d[i]*d[j]
      |                             ^
      |                             ;
   15 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,S=0,X=0;cin>>N;vector<int>d(N);
  for(int i=0;i<N;i++){
    cin>>d.at(i);S+=d.at(i)
  }
  for(int i=0;i<N;i++)X+=(S-d.at(i))*d.at(i);
  cout<<X<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: expected ';' before '}' token
    6 |     cin>>d.at(i);S+=d.at(i)
      |                            ^
      |                            ;
    7 |   }
      |   ~
Language: C++

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

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin << d(i);
      |            ~^~~
a.cc:14:18: error: no match for call to '(std::vector<int>) (int&)'
   14 |       answer += d(i) * d(j);
      |                 ~^~~
a.cc:14:25: error: no match for call to '(std::vector<int>) (int&)'
   14 |       answer += d(i) * d(j);
      |                        ~^~~
Language: C++

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

int main () {
  int N;
  cin >> N;
  vedtor <int> d(N);
  for(int i = 0; i < N; i++){
    cin << d(i);
  }
  int answer = 0;
  for(int i = 0; i < N; i++){
    for(int j = i + 1; j < N; j++){
      answer += d(i) * d(j);
    }
  }
  cout << answer << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vedtor' was not declared in this scope
    7 |   vedtor <int> d(N);
      |   ^~~~~~
a.cc:7:11: error: expected primary-expression before 'int'
    7 |   vedtor <int> d(N);
      |           ^~~
a.cc:9:12: error: 'd' was not declared in this scope
    9 |     cin << d(i);
      |            ^
a.cc:14:17: error: 'd' was not declared in this scope
   14 |       answer += d(i) * d(j);
      |                 ^
Language: C++

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

int main() {
  int a;
  cin >> a;
  vector<int> data(a);
  for (int i = 0; i < a; i++) {
    cin >> data.at(i);
  }
  
  int count = 0;
  for (int i = 0; i < a; i++) {
    for (int j = i + 1; j < a; j++) {
      s = data.at(i)*data.at(j);
      count += s;
    }
  }
  
  cout << count <<endl;
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 's' was not declared in this scope
   15 |       s = data.at(i)*data.at(j);
      |       ^
Language: C++

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

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


}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'std::vector<int> n'
    7 | vector<int>n(d);
      |            ^
a.cc:5:5: note: previous declaration as 'int n'
    5 | int n;
      |     ^
a.cc:7:14: error: 'd' was not declared in this scope
    7 | vector<int>n(d);
      |              ^
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     cin >> n[i];
      |             ^
a.cc:14:16: error: expected primary-expression before 'int'
   14 |         sum += int[i] * int[j];
      |                ^~~
Language: C++

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

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'd' was not declared in this scope
    7 | vector<int>n[d];
      |              ^
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     cin >> n[i];
      |             ^
a.cc:14:16: error: expected primary-expression before 'int'
   14 |         sum += int[i] * int[j];
      |                ^~~
Language: C++

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

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'd' was not declared in this scope
    7 | vector<int>n[d];
      |              ^
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     cin >> n[i];
      |             ^
a.cc:14:16: error: expected primary-expression before 'int'
   14 |         sum += int[i] * int[j];
      |                ^~~
Language: C++

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

Compiler output:
a.cc:2:1: error: '\U0000200b' does not name a type
    2 | ​
      |
Language: C

#include <stdio.h>
int main(void){
    int N;
    int d[50],s[50][50];
    
    //標準入力
    scanf("%d", &N);
    for(int i = 0;i < N; i++) {
       scanf("%d", &d[i]);
    }
  
    for(int i = 1; i < N; i++) {
       for(int j = 0; j < i; j++) {
         s[i-1][j] = d[j] * d[i];
       }
    }
    
    //計算
  　int sum = 0;
     for(int i = 1; i < N; i++) {
       for(int j = 0; j < i; j++) {
         sum += s[i-1][j]
       }
    }
    //出力
    printf("%d\n", sum);
  
    return 0;

Compiler output:
main.c: In function 'main':
main.c:19:3: error: stray '\343' in program
   19 |   <U+3000>int sum = 0;
      |   ^~~~~~~~
main.c:22:26: error: expected ';' before '}' token
   22 |          sum += s[i-1][j]
      |                          ^
      |                          ;
   23 |        }
      |        ~                  
main.c:28:5: error: expected declaration or statement at end of input
   28 |     return 0;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <vector>

int main(){
  int n;
  std::cin >> n;
  std::vector<int> d;
  int temp;
  while(std::cin >> temp)
    d.push_back(temp);
  int rec = 0;
  for(int i=0; i<n; ++i)
    rec -= d[i]*d[i];
    for(int j=0; j<n; ++j)
      rec += d[i]*d[j];
  std::cout << rec << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'i' was not declared in this scope
   15 |       rec += d[i]*d[j];
      |                ^
Language: C++

#include <iostream>
#include <array>

int main(){
  int n;
  std::cin >> n;
  const int cn(n);
  std::array<int,cn> d;
  int temp;
  while(std::cin >> temp)
    d.push_back(temp);
  int rec = 0;
  for(int i=0; i<n; ++i)
    rec -= d[i]*d[i];
    for(int j=0; i<n; ++j)
      rec += d[i]*d[j];
  std::cout << rec << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: the value of 'cn' is not usable in a constant expression
    8 |   std::array<int,cn> d;
      |                    ^
a.cc:7:13: note: 'cn' was not initialized with a constant expression
    7 |   const int cn(n);
      |             ^~
a.cc:8:20: note: in template argument for type 'long unsigned int'
    8 |   std::array<int,cn> d;
      |                    ^
a.cc:11:7: error: request for member 'push_back' in 'd', which is of non-class type 'int'
   11 |     d.push_back(temp);
      |       ^~~~~~~~~
a.cc:14:13: error: invalid types 'int[int]' for array subscript
   14 |     rec -= d[i]*d[i];
      |             ^
a.cc:14:18: error: invalid types 'int[int]' for array subscript
   14 |     rec -= d[i]*d[i];
      |                  ^
a.cc:15:18: error: 'i' was not declared in this scope
   15 |     for(int j=0; i<n; ++j)
      |                  ^
a.cc:16:20: error: invalid types 'int[int]' for array subscript
   16 |       rec += d[i]*d[j];
      |                    ^
Language: C++

#include <iostream>
#include <array>

int main(){
  int n;
  std::cin >> n;
  const int cn = n;
  std::array<int,cn> d;
  int temp;
  while(std::cin >> temp)
    d.push_back(temp);
  int rec = 0;
  for(int i=0; i<n; ++i)
    rec -= d[i]*d[i];
    for(int j=0; i<n; ++j)
      rec += d[i]*d[j];
  std::cout << rec << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: the value of 'cn' is not usable in a constant expression
    8 |   std::array<int,cn> d;
      |                    ^
a.cc:7:13: note: 'cn' was not initialized with a constant expression
    7 |   const int cn = n;
      |             ^~
a.cc:8:20: note: in template argument for type 'long unsigned int'
    8 |   std::array<int,cn> d;
      |                    ^
a.cc:11:7: error: request for member 'push_back' in 'd', which is of non-class type 'int'
   11 |     d.push_back(temp);
      |       ^~~~~~~~~
a.cc:14:13: error: invalid types 'int[int]' for array subscript
   14 |     rec -= d[i]*d[i];
      |             ^
a.cc:14:18: error: invalid types 'int[int]' for array subscript
   14 |     rec -= d[i]*d[i];
      |                  ^
a.cc:15:18: error: 'i' was not declared in this scope
   15 |     for(int j=0; i<n; ++j)
      |                  ^
a.cc:16:20: error: invalid types 'int[int]' for array subscript
   16 |       rec += d[i]*d[j];
      |                    ^
Language: C++

#include <iostream>
#include <array>

int main(){
  int n;
  std::cin >> n;
  std::array<int,n> d;
  int temp;
  while(std::cin >> temp)
    d.push_back(temp);
  int rec = 0;
  for(int i=0; i<n; ++i)
    rec -= d[i]*d[i];
    for(int j=0; i<n; ++j)
      rec += d[i]*d[j];
  std::cout << rec << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: the value of 'n' is not usable in a constant expression
    7 |   std::array<int,n> d;
      |                   ^
a.cc:5:7: note: 'int n' is not const
    5 |   int n;
      |       ^
a.cc:7:19: note: in template argument for type 'long unsigned int'
    7 |   std::array<int,n> d;
      |                   ^
a.cc:10:7: error: request for member 'push_back' in 'd', which is of non-class type 'int'
   10 |     d.push_back(temp);
      |       ^~~~~~~~~
a.cc:13:13: error: invalid types 'int[int]' for array subscript
   13 |     rec -= d[i]*d[i];
      |             ^
a.cc:13:18: error: invalid types 'int[int]' for array subscript
   13 |     rec -= d[i]*d[i];
      |                  ^
a.cc:14:18: error: 'i' was not declared in this scope
   14 |     for(int j=0; i<n; ++j)
      |                  ^
a.cc:15:20: error: invalid types 'int[int]' for array subscript
   15 |       rec += d[i]*d[j];
      |                    ^
Language: C

#include <stdio.h>
int main(void){
    int N;
    int d[50];
    
    //標準入力
    scanf("%d", &N);
    for(int i = 0;i < N; i++) {
       scanf("%d", &d[i]);
    }
  
    //計算
    int sum = 0;
    for(int i = 1; i < N; i++) {
       for(int j = 0; j < i; j++) {
          sum += d[j] * d[i];
       }
    }
    
  　//出力
    printf("%d\n", sum);
  
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:3: error: stray '\343' in program
   20 |   <U+3000>//<U+51FA><U+529B>
      |   ^~~~~~~~
Language: C

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

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

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

Compiler output:
main.c: In function 'main':
main.c:16:20: error: 'sum' undeclared (first use in this function)
   16 |     printf("%d\n", sum);
      |                    ^~~
main.c:16:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

def calc_double(n):
    return n ** 2

n=int(input())
L=list(map(int,input().split()))
L2=list(map(calc_double,L))
print((sum(L)**2-sum(L2))//2)

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 's' was not declared in this scope
   18 |       s=s+(a[i]*a[j]);
      |       ^
a.cc:21:9: error: 's' was not declared in this scope
   21 |   cout<<s;
      |         ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  for(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+=a[i]*a[j];
    }
  }
  cout<<sum;
}
      
  

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

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

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'result' was not declared in this scope
   17 |             result += d[i] * d[j];
      |             ^~~~~~
a.cc:20:13: error: 'result' was not declared in this scope
   20 |     cout << result << endl;
      |             ^~~~~~
Language: Java

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int[] nums = new int[N];
        for (int i = 0; i < N; i++) {
            nums[i] = Integer.parseInt(in.next());
        } 

        int res = 0;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                res += (nums[i] * nums[j]);
            }
        }
        System.out.println(res);
    }
}

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 <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){

    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

bool IsPrime(ll num){
    if(num < 2) return false;
    else if(num == 2) return true;
    else if(num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for(ll i = 3; i <= sqrtNum; i += 2){
        if(num%i==0){
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}

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



  return 0;
}


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

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

int main() {
  int N;
  cin >> N;
  queue<int> tako;
  for(int i=0;i<N*(N-1)/2;i++){
    int a;
    cin >> a;
    tako.push(a);
  }
  int cnt=0;
  for(int i=0;i<tako.size();i++){
    for(int j=0;j<tako.size();j++){
      cnt += tako[i]*tako[j];
    }
  }
  for(int i=0;i<tako.size();i++){
    cnt -= tako[i]*tako[i];
  }
  cout << cnt/(N-2)*2 << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   16 |       cnt += tako[i]*tako[j];
      |                  ^
a.cc:16:26: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   16 |       cnt += tako[i]*tako[j];
      |                          ^
a.cc:20:16: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   20 |     cnt -= tako[i]*tako[i];
      |                ^
a.cc:20:24: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   20 |     cnt -= tako[i]*tako[i];
      |                        ^
Language: Java

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] d = new int[N];

    int[] n = new int[N*(N-1)/2];
    int m = 0;

    for(int i=0; i<N; i++){
       for(int j=1; j<N; j++){
          

             int a = d[i]*d[j];
             m += a;
          
       }
    }
    System.out.println(a);
  }
}

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

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] d = new int[N];

    int[] n = new int[N*(N-1)/2];
    int m = 0;

    for(int i=0; i<N; i++){
       for(int j=1; j<N; j++){
          

             a = d[i]*d[j];
             m += a;
          
       }
    }
    System.out.println(a);
  }
}

Compiler output:
Main.java:18: error: cannot find symbol
             a = d[i]*d[j];
             ^
  symbol:   variable a
  location: class Main
Main.java:19: error: cannot find symbol
             m += a;
                  ^
  symbol:   variable a
  location: class Main
Main.java:23: error: cannot find symbol
    System.out.println(a);
                       ^
  symbol:   variable a
  location: class Main
3 errors
Language: Java

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] d = new int[N];

    int[] n = new int[N*(N-1)/2];
    int n = 0;

    for(int i=0; i<N; i++){
       for(int j=1; j<N; j++){
          for(int k=0; k<N*(N-1)/2; k++){

             n[k] = d[i]*d[j];
             n += n[k];
          }
       }
    }
    System.out.println(n);
  }
}


Compiler output:
Main.java:12: error: variable n is already defined in method main(String[])
    int n = 0;
        ^
Main.java:18: error: array required, but int found
             n[k] = d[i]*d[j];
              ^
Main.java:19: error: array required, but int found
             n += n[k];
                   ^
3 errors
Language: C++

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

int main()
{
    int n,a=0,sum=0,x;
    cin>>n;
    rep(i,n) cin>>x, sum+=x, a+=x*x;
    cout<<(sum*sum-a)/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     rep(i,n) cin>>x, sum+=x, a+=x*x;
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i,n) cin>>x, sum+=x, a+=x*x;
      |     ^~~
Language: C++

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

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


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

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

int main() {
  int N ;
  int d;
  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++){
      sum +=d.at(i)+d.at(j);
    }
  }
  cout << sum << endl;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'vec' was not declared in this scope
    8 |     cin << vec.at(i);
      |            ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'vec' was not declared in this scope
    8 |     cin << vec.at(i);
      |            ^~~
a.cc:13:13: error: 'vec' was not declared in this scope
   13 |       sum +=vec.at(i)+vec.at(j);
      |             ^~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <time.h>
using namespace std;

int main() {
    int N;
    //string S={0};
    //たこやき1 おいしさp たこ焼き2 おいしさq pq回復 nP2 sigma nP2
    cin >> N;
    if !(2<=N&&N<=50){
      return 1;
    }

    int d[N]={0};
    int i=0;
    for(i;i<N;i++){
      cin >> d[i];
      if !(0<=d[i]&&d[i]<=100){
        return 1;
      }
    }
    //if N 4 12 13 14 23 34
    //N=0123 (01,02,03,12,13,14?,23) N=4
    int sum=0;
    int j=1;
    //while(j=1){

      for(i=0;i<N;i++){
        for(int k=i+1;k<=N;k++){
          sum+=d[i]*d[k];
        }
      }
    cout << sum;
    //}





    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: expected '(' before '!' token
   13 |     if !(2<=N&&N<=50){
      |        ^
      |        (
a.cc:21:10: error: expected '(' before '!' token
   21 |       if !(0<=d[i]&&d[i]<=100){
      |          ^
      |          (
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int> s(n);
  for (int i=0;i<n;i++) {
    cin>>s[i];
  }
  int sum = 0;
  for (int i=0;i<n;i++) {
    for(int j=0;j<n;j++) {
      if (i != j) sum += s[i] * s[j];
    }
  }
  cout<<sum / 2<<endl;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> s(n);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> s(n);
      |          ^~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s[i];
      |          ^
a.cc:14:26: error: 's' was not declared in this scope
   14 |       if (i != j) sum += s[i] * s[j];
      |                          ^
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout<<sum / 2<<endl;
      |   ^~~~
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout<<sum / 2<<endl;
      |                  ^~~~
Language: C++

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

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

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define ALL(v) v.begin(),v.end()
typedef long long ll;
int main() {
  int n; 
  cin >> n; 
  vector<int> d(n);
  int count; 
  rep(i,n){
    cin >> a.at(i);
    count +=a.at(i)*a.at(i);
  }
  int sum; 
  for(int i=0; i<n; i++){
  	for(int j=0; j<n; j++){
      sum+=d.at(i)*d.at(j);
    }
  }
  cout << (sum-count)/2 << endl;
}


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

#include <iostream>
#include<vector>
using namespace std;
int main(void){
int n;
cin>>n;
for (int i=0; i<=n; i++){
    cin>>d[i];
}
for (int j=l i<n; i++){
    j=n+1;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'd' was not declared in this scope
    8 |     cin>>d[i];
      |          ^
a.cc:10:12: error: 'l' was not declared in this scope
   10 | for (int j=l i<n; i++){
      |            ^
a.cc:10:19: error: 'i' was not declared in this scope
   10 | for (int j=l i<n; i++){
      |                   ^
a.cc:10:22: error: expected ';' before ')' token
   10 | for (int j=l i<n; i++){
      |                      ^
      |                      ;
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C

#include <stdio.h>

int main()
{
  int i, j, sum;
  scanf("%d",&n);
  int int[n];
  for(i = 1; i <= n；scanf("%d",&int[i]));
  for(i = 1 ; i < n ; i++){
    for(j = i + j ; j <= n ; j++) sum += int[i] * int[j]; 
  }
  printf("%d",sum);
}
  

Compiler output:
main.c: In function 'main':
main.c:6:15: error: 'n' undeclared (first use in this function)
    6 |   scanf("%d",&n);
      |               ^
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:7: error: two or more data types in declaration specifiers
    7 |   int int[n];
      |       ^~~
main.c:7:10: error: expected identifier or '(' before '[' token
    7 |   int int[n];
      |          ^
main.c:8:19: error: implicit declaration of function 'n\U0000ff1bscanf' [-Wimplicit-function-declaration]
    8 |   for(i = 1; i <= n；scanf("%d",&int[i]));
      |                   ^~~~~~~~
main.c:8:34: error: expected expression before 'int'
    8 |   for(i = 1; i <= n；scanf("%d",&int[i]));
      |                                  ^~~
main.c:8:41: error: expected ';' before ')' token
    8 |   for(i = 1; i <= n；scanf("%d",&int[i]));
      |                                         ^
      |                                         ;
main.c:10:42: error: expected expression before 'int'
   10 |     for(j = i + j ; j <= n ; j++) sum += int[i] * int[j];
      |                                          ^~~
Language: C++

#include <iostream>
#include<algorithm>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'll' was not declared in this scope
   12 |   ll ans = 0;
      |   ^~
a.cc:15:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |       ans += d[a]*d[b];
      |       ^~~
      |       abs
a.cc:18:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
	
	vector<int> v;
	vector<int> ::iterator it;
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	cin>>a[i];
	for(int i=0;i<n-1;i++)
	{
		for(int j=1+i;j<n;j++)
		{
			v.push_back(a[i]*a[j]);
		}
 }
	int sum=0;
	for(it=v.begin();it!=v.end();it++)
	sum=sum+*it;
	cout<<sum;
}

Compiler output:
main.c: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>
using namespace std;
int main(){
    int n;
    cin>>n;
    int h[];
    for(int i = 0; i < n; i++){
       cin>>h[i] ;
    }
    int ans = 0 ;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            ans+=h[i]*h[j];
        }
    }
    cout << ans << endl;
    return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: storage size of 'h' isn't known
    6 |     int h[];
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define Dcout(N) cout << setprecision(20) << N << endl
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
constexpr long long INFF = 9223372036854775807;

signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    int N;cin >> N;
    int A[i];REP(i,N) cin >> A[i];
    ll ans = 0;
    REP(i,N){
        REPP(j,i+1,N){
            ans += A[i]*A[j];
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'i' was not declared in this scope
   21 |     int A[i];REP(i,N) cin >> A[i];
      |           ^
a.cc:21:30: error: 'A' was not declared in this scope
   21 |     int A[i];REP(i,N) cin >> A[i];
      |                              ^
a.cc:25:20: error: 'A' was not declared in this scope
   25 |             ans += A[i]*A[j];
      |                    ^
Language: C++


#include <iostream>
#include <vector>

int main()
{
  int N = 0;
  std::cin >> N:
  std::vector<int> _d(N);
  auto * const d = &_d[0];
  for (int i = 0; i < N; ++i)
    std::cin >> d[i];
  long long sum = 0;
  for (int i = 0, _i = N - 1; i < _i; ++i)
    for (int j = i + 1; j < N; ++j)
      sum += d[i]*d[j];
  std::cout << sum;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: found ':' in nested-name-specifier, expected '::'
    8 |   std::cin >> N:
      |                ^
      |                ::
a.cc:8:15: error: 'N' is not a class, namespace, or enumeration
    8 |   std::cin >> N:
      |               ^
a.cc:9:15: error: expected primary-expression before 'int'
    9 |   std::vector<int> _d(N);
      |               ^~~
a.cc:10:21: error: '_d' was not declared in this scope; did you mean 'd'?
   10 |   auto * const d = &_d[0];
      |                     ^~
      |                     d