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

#include <stdio.h>
int main(void)
{
	int i, j, n, a[100], sum = 0;

	scanf_s("%d", &n);
	for (i = 0; i < n; i++)
		scanf_s("%d", &a[i]);

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

	printf("%d", sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

int main(void)
{
    
    int N,i,j,x;
    int *a;
    scanf("%d",&N);
    x = 0;
    
    for (i=0; i<N; i++) {
        scanf("%d", &a[i]);
    }
    for (j=0; j<N-1; j++) {
        for (i=j+1; j<=N; j++) {
            x += a[i]*a[j]
        }
    }

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |     scanf("%d",&N);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:6:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |     scanf("%d",&N);
      |     ^~~~~
main.c:6:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:27: error: expected ';' before '}' token
   14 |             x += a[i]*a[j]
      |                           ^
      |                           ;
   15 |         }
      |         ~
Language: Java

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Integer a[] = new Integer[N];
        for (int i=0; i<N; i++) {
            a[i] = sc.nextInt();
        }
      
      int sum = 0;
      
      for (int i = 0; i < N-1; i++) {
        for (int j = i+1; j < N; j++) {
          sum += a[i] * a[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

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Integer a[] = new Integer[N];
        for (int i=0; i<N; i++) {
            a[i] = sc.nextInt();
        }
      
      int sum = 0;
      
      for (int i = 0; i < N-1; i++) {
        for (int j = i+1; j < n; j++) {
          sum += a[i] * a[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
Main.java:13: error: cannot find symbol
        for (int j = i+1; j < n; j++) {
                              ^
  symbol:   variable n
  location: class Main
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LOOP(i,o) for(i=0;i<o;i++)
int main() {
  int n;
  cin>>n;
  vector<int> a(n);
  LOOP(i,n){
    cin>>a[i];
  }
  int ans=0;
  LOOP(i,n-1){
    for(int j=i+1;j<n;j++){
      ans+=a[i]*a[j];
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   LOOP(i,n){
      |        ^
a.cc:3:23: note: in definition of macro 'LOOP'
    3 | #define LOOP(i,o) for(i=0;i<o;i++)
      |                       ^
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   LOOP(i,n-1){
      |        ^
a.cc:3:23: note: in definition of macro 'LOOP'
    3 | #define LOOP(i,o) for(i=0;i<o;i++)
      |                       ^
Language: C++

#include<stdio.h>
int main(void) {
	const int num=1;
	scanf("%d", &num);
	int a[num];
	for (int i = 0; i < num; i++) {
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < num; i++) {
		for(int j=1;j<num;j++){
			if (i == j) {
				continue;
			}
			printf("%d", a[i]*a[j]);
	}
}

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

///                ..:: In The Name Of God ::..
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(j, i, n) for(int j = i+1; j < n; j++)
#define endl    'n'
#define INF 2e9
#define int ll
#define vi          vector<int>
#define de          deque<int>
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()//全範囲指定を簡略化
typedef long long ll;
using namespace std;
//配列の要素数は　sizeof(ar)/sizeof(ar[0]) で求める
signed main(){
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
int n ;
int arr[100]
cin >> n;
REP(i,n){
    cin >> arr[i];
}

int ans;

REP(i,n){
    FOR(j,i,n){
        ans += arr[i]*arr[j];
    }
}

cout << ans << endl;

return 0;
    


}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:1: error: expected initializer before 'cin'
   22 | cin >> n;
      | ^~~
a.cc:24:12: error: 'arr' was not declared in this scope
   24 |     cin >> arr[i];
      |            ^~~
a.cc:31:16: error: 'arr' was not declared in this scope
   31 |         ans += arr[i]*arr[j];
      |                ^~~
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
using namespace std;

#define MAX_N 100000000
#define INF 100000000000000

int main(){
  int n;
  cin >> n;
  long long d;
  for(int i=0;i<n;i++) cin >> d[i];
  long long ans;
  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:22:32: error: invalid types 'long long int[int]' for array subscript
   22 |   for(int i=0;i<n;i++) cin >> d[i];
      |                                ^
a.cc:26:15: error: invalid types 'long long int[int]' for array subscript
   26 |       ans += d[i]*d[j];
      |               ^
a.cc:26:20: error: invalid types 'long long int[int]' for array subscript
   26 |       ans += d[i]*d[j];
      |                    ^
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
using namespace std;

#define MAX_N 100000000
#define INF 100000000000000

int main(){
  int n;
  cin >> n;
  long long d;
  for(int i-0;i<n;i++) cin >> d[i];
  long long ans;
  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:22:12: error: expected ';' before '-' token
   22 |   for(int i-0;i<n;i++) cin >> d[i];
      |            ^
      |            ;
a.cc:22:18: error: expected ')' before ';' token
   22 |   for(int i-0;i<n;i++) cin >> d[i];
      |      ~           ^
      |                  )
a.cc:22:19: error: 'i' was not declared in this scope
   22 |   for(int i-0;i<n;i++) cin >> d[i];
      |                   ^
a.cc:26:15: error: invalid types 'long long int[int]' for array subscript
   26 |       ans += d[i]*d[j];
      |               ^
a.cc:26:20: error: invalid types 'long long int[int]' for array subscript
   26 |       ans += d[i]*d[j];
      |                    ^
Language: C

#include<stdio.h>

int main(void){
  int n=0;
  scanf("%d",&n);
  array[50];
  for(int i=0;i<n;i++)
    scanf("%d",&array[i]);
  long long int sum=0
  for(int i=0;i<n;i++)
    for(int j=i+1;j<n;j++){
      sum+=array[i]*array[j];
    }
  printf("%lld",sum);
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: 'array' undeclared (first use in this function)
    6 |   array[50];
      |   ^~~~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:3: error: expected ',' or ';' before 'for'
   10 |   for(int i=0;i<n;i++)
      |   ^~~
main.c:10:15: error: 'i' undeclared (first use in this function)
   10 |   for(int i=0;i<n;i++)
      |               ^
main.c:10:22: error: expected ';' before ')' token
   10 |   for(int i=0;i<n;i++)
      |                      ^
      |                      ;
main.c:10:22: error: expected statement before ')' token
Language: C++

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


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

  vector<int> data(N);

  for (int i = 0;i < N ; i++){
   cin >> data.at(i); 
  }
  
  int ref=0;
  
  for(int i = 0 i < N-1; i++){
   for(int j = 1 j < N; j++){
     ref += data.at(i)*data.at(j);
   }
  }
  
  cout << ref << endl;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: expected ';' before 'i'
   17 |   for(int i = 0 i < N-1; i++){
      |                ^~
      |                ;
a.cc:18:17: error: expected ';' before 'j'
   18 |    for(int j = 1 j < N; j++){
      |                 ^~
      |                 ;
Language: C++

#include<stdio.h>
int n = in.nextInt();
int[] d = in.readIntArray(n);

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

out.println(answer);

Compiler output:
a.cc:2:9: error: 'in' was not declared in this scope; did you mean 'n'?
    2 | int n = in.nextInt();
      |         ^~
      |         n
a.cc:3:4: error: structured binding declaration cannot have type 'int'
    3 | int[] d = in.readIntArray(n);
      |    ^~
a.cc:3:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:3:4: error: empty structured binding declaration
a.cc:3:7: error: expected initializer before 'd'
    3 | int[] d = in.readIntArray(n);
      |       ^
a.cc:6:1: error: expected unqualified-id before 'for'
    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:6:24: error: 'i' does not name a type
    6 | for (int i = 0; i < n; i++) {
      |                        ^
a.cc:12:1: error: 'out' does not name a type
   12 | out.println(answer);
      | ^~~
Language: C++

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


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

  vector<int> data(N);

  for (int i = 0;i < N ; i++){
   cin >> data(i); 
  }
  
  int ref=0;
  
  for(int i = 0 i < N-1; i++){
   for(int j = 1 j < N; j++){
     ref += data(i)*data(j);
   }
  }
  
  cout << ref << endl;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: no match for call to '(std::vector<int>) (int&)'
   12 |    cin >> data(i);
      |           ~~~~^~~
a.cc:17:16: error: expected ';' before 'i'
   17 |   for(int i = 0 i < N-1; i++){
      |                ^~
      |                ;
a.cc:18:17: error: expected ';' before 'j'
   18 |    for(int j = 1 j < N; j++){
      |                 ^~
      |                 ;
a.cc:19:17: error: no match for call to '(std::vector<int>) (int&)'
   19 |      ref += data(i)*data(j);
      |             ~~~~^~~
a.cc:19:25: error: no match for call to '(std::vector<int>) (int&)'
   19 |      ref += data(i)*data(j);
      |                     ~~~~^~~
Language: C++

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

int main(){
  int n,sum=0,sqsum=0;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
    sum+=a[i];
    sqsum+=a[i]*a[i];
  }
  cout << sum*sum-suqsum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'suqsum' was not declared in this scope; did you mean 'sqsum'?
   13 |   cout << sum*sum-suqsum << endl;
      |                   ^~~~~~
      |                   sqsum
Language: C++

using namespace std;

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

  cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | using namespace std;
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   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 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> d(N);
      |          ^~~
a.cc:8:12: error: 'd' was not declared in this scope
    8 |     cin >> d.at(i);
      |            ^
a.cc:14:21: error: 'd' was not declared in this scope
   14 |        ans = ans + (d.at(i)*d.at(j));
      |                     ^
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout << ans << endl;
      |   ^~~~
a.cc:18:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:18: error: 'endl' was not declared in this scope
   18 |   cout << ans << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main(){
  long n,sum1=0,sum2=0;
  cin>>n;
  vector<long> v;
  for(long i=0;i<n;i++){
    long x;
    cin>>x;
    sum1+=x;
    v.push_back(x);  
  }
  for(long i=0;i<n;i++){
    sum2+ = v[i]*(sum1-v[i]);
  }
  cout<<sum2/2;
  cout<<endl;




}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: expected primary-expression before '=' token
   15 |     sum2+ = v[i]*(sum1-v[i]);
      |           ^
Language: C++

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

int main(){
  long n,sum1=0,sum2=0;
  cin>>n;
  vector<long> v;
  for(ll i=0;i<n;i++){
    long x;
    cin>>x;
    sum1+=x;
    v.push_back(x);  
  }
  for(ll i=0;i<n;i++){
    sum2+ = v[i]*(sum1-v[i]);
  }
  cout<<sum2/2;
  cout<<endl;




}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'll' was not declared in this scope
    8 |   for(ll i=0;i<n;i++){
      |       ^~
a.cc:8:14: error: 'i' was not declared in this scope
    8 |   for(ll i=0;i<n;i++){
      |              ^
a.cc:14:7: error: 'll' was not declared in this scope
   14 |   for(ll i=0;i<n;i++){
      |       ^~
a.cc:14:14: error: 'i' was not declared in this scope
   14 |   for(ll i=0;i<n;i++){
      |              ^
a.cc:15:11: error: expected primary-expression before '=' token
   15 |     sum2+ = v[i]*(sum1-v[i]);
      |           ^
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
   Scanner sc = new scanner(System.in);
    int a = sc.nextInt();
    int b[] = new int[a-1];
    int c = 0;
    for(int i = 0;i < b.length;i++){
      b[i] = sc.nextInt();
      if(i > 0){
      c += b[i-1]*b[i];  
      }
    }
    System.out.println(c);
  }
}


Compiler output:
Main.java:4: error: cannot find symbol
   Scanner sc = new scanner(System.in);
                    ^
  symbol:   class scanner
  location: class Main
1 error
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 ALL(v) v.begin(),v.end()
typedef long long ll;
int main() {
  int n;
  cin >> n;
  int sum;
  int sum2;
  rep(i,n){
    int p;
    cin >> p;
    sum+=p;
    sum2+=p*p;
  }
  cout << (sum-sum2)/2
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: expected ';' before '}' token
   18 |   cout << (sum-sum2)/2
      |                       ^
      |                       ;
   19 | }
      | ~
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>>vec[i];
  int ans=0;
  
  for(int i=0;i<n-1;i++)
    for(int j=i+1;j<n;j++)ans+=vec[i]*vec[j];
  
  cout<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: 'vec' was not declared in this scope
   11 |   for(int i=0;i<n;i++)cin>>vec[i];
      |                            ^~~
a.cc:15:32: error: 'vec' was not declared in this scope
   15 |     for(int j=i+1;j<n;j++)ans+=vec[i]*vec[j];
      |                                ^~~
Language: C++

#include<iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> v(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 | 
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> v(n);
      |            ^~~
a.cc:11:28: error: 'vec' was not declared in this scope
   11 |   for(int i=0;i<n;i++)cin>>vec[i];
      |                            ^~~
a.cc:15:32: error: 'vec' was not declared in this scope
   15 |     for(int j=i+1;j<n;j++)ans+=vec[i]*vec[j];
      |                                ^~~
Language: C

#include <stdio.h>

int main(void){

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

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

#include<stdio.h>
int main(){
  int n;
  scanf("%d",&n);
  int a[n];
  int ans = 0;
  for(int i=0;i<n;i++)scanf("%d",&a[i]);
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      ans+=(j==i)?0;a[i]*a[j];
    }
  }
  printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:10:20: error: expected ':' before ';' token
   10 |       ans+=(j==i)?0;a[i]*a[j];
      |                    ^
      |                    :
Language: C++

#include<bits/stdc++.h >
using namespace std ; 
#define pb push_back  
int main()
{
	int n ; 
  cin>>n ; 
  vector<int > v ; 
  for(int i =0 ;i<n;i++)
  {
    int temp ; 
    cin>>temp ; 
    v.pb(temp) ; 
  }
  long long ans = 0 ; 
  for(int i =0 ;i<n-1;i++)
  {
    for(int j =i ; j<n;j++)
      ans += v[i]*v[j] ; 
  }
  cout <<ans ; 
  
  
}

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

#include<bits/stdc++.h>
using namespace std ; 
#define pb push_back ; 
int main()
{
	int n ; 
  cin>>n ; 
  vector<int > v ; 
  for(int i =0 ;i<n;i++)
  {
    int temp ; 
    cin>>temp ; 
    v.pb(temp) ; 
  }
  long long ans = 0 ; 
  for(int i =0 ;i<n-1;i++)
  {
    for(int j =i ; j<n;j++)
      ans += v[i]*v[j] ; 
  }
  cout <<ans ; 
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: statement cannot resolve address of overloaded function
    3 | #define pb push_back ;
      |            ^
a.cc:13:7: note: in expansion of macro 'pb'
   13 |     v.pb(temp) ;
      |       ^~
Language: C++

#include<bits/stdc++.h >
using namespace std ; 
#define pb push_back ; 
int main()
{
	int n ; 
  cin>>n ; 
  vector<int > v ; 
  for(int i =0 ;i<n;i++)
  {
    int temp ; 
    cin>>temp ; 
    v.pb(temp) ; 
  }
  long long ans = 0 ; 
  for(int i =0 ;i<n-1;i++)
  {
    for(int j =i ; j<n;j++)
      ans += v[i]*v[j] ; 
  }
  cout <<ans ; 
  
  
}

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

import java.util.Scanner;
public class Takoyaki {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();

		int sum = 0;
		int [] a = new int[n];
		for(int i = 0;i < n; i++) {
			a[i] = stdIn.nextInt();
		}

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

		System.out.println(sum);


	}

}

Compiler output:
Main.java:2: error: class Takoyaki is public, should be declared in a file named Takoyaki.java
public class Takoyaki {
       ^
1 error
Language: Java

 class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();

		int sum = 0;
		int [] a = new int[n];
		for(int i = 0;i < n; i++) {
			a[i] = stdIn.nextInt();
		}

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

		System.out.println(sum);


	}

}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner stdIn = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner stdIn = new Scanner(System.in);
		                    ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: invalid types 'int[int]' for array subscript
    7 |   { cin >>d[i];
      |            ^
a.cc:8:7: error: invalid types 'int[int]' for array subscript
    8 |    s=d[i]*d[i+1];
      |       ^
a.cc:8:12: error: invalid types 'int[int]' for array subscript
    8 |    s=d[i]*d[i+1];
      |            ^
Language: Java

import java.util.Scanner;
public class MAIN
{
  public static void main(String args[])
  {
    Scanner sc = new Scanner(System.in);
    int n;
    n = sc.nextInt();
    int d[]=new int[n];
    for(int i=0;i<n;i++)
      d[i]=sc.nextInt();
   	long int ans=0;
    for(int i=0;i<n-1;i++)
    {
      for(int j=i+1;j<n;j++)
        ans+=(d[i]*d[j]);
    }
  }
}

Compiler output:
Main.java:12: error: not a statement
   	long int ans=0;
   	^
Main.java:12: error: ';' expected
   	long int ans=0;
   	    ^
2 errors
Language: C++

n = int(input())
lis = list(map(int,input().split()))
ans = 0
num = sum(lis)
for i in range(n):
  num -= lis[i]
  ans += lis[i] * num
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
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 ans = 0;
    int tmp = 0;
    for(int i=0;i<N;i++){
      d[i]=sc.nextInt();
    }
    for(int i=0;i<N;i++){
      tmp += d[i]*d[i];
      for(int j=0;j<i;j++){
        ans+=d[i]*d[j];
      }
    }
    ans-=tmp;
    System.out.print(ans);
  }
}
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 ans = 0;
    int tmp = 0;
    for(int i=0;i<N;i++){
      d[i]=sc.nextInt();
    }
    for(int i=0;i<N;i++){
      tmp += d[i]*d[i];
      for(int j=0;j<i;j++){
        ans+=d[i]*d[j];
      }
    }
    ans-=tmp;
    System.out.print(ans);
  }
}

Compiler output:
Main.java:22: error: class, interface, enum, or record expected
import java.util.*;
^
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 ans = 0;
    int tmp = 0;
    for(int i=0;i<N;i++){
      d[i]=sc.nextInt();
    }
    for(int i=0;i<N;i++){
      tmp += d[i]*d[i];
      for(int j=0;j<i;j++){
        ans+=d[i]*d[j];
      }
    }
    ans-=tmp;
    System.out.print(ans);
  }
}
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 ans = 0;
    int tmp = 0;
    for(int i=0;i<N;i++){
      d[i]=sc.nextInt();
    }
    for(int i=0;i<N;i++){
      tmp += d[i]*d[i];
      for(int j=0;j<i;j++){
        ans+=d[i]*d[j];
      }
    }
    ans-=tmp;
    System.out.print(ans);
  }
}
提出情報

Compiler output:
Main.java:22: error: class, interface, enum, or record expected
import java.util.*;
^
Main.java:43: error: reached end of file while parsing
????
^
2 errors
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:14:20: error: lvalue required as left operand of assignment
   14 |   int_d[i]*int_d[j]=z;
      |                    ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:5:16: error: called object 'a' is not a function or function pointer
    5 |    for(a=1; a<=a(a-1)/2; a++){
      |                ^
main.c:3:8: note: declared here
    3 |    int a,c=0;
      |        ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:14:20: error: lvalue required as left operand of assignment
   14 |   int_d[i]*int_d[j]=z;
      |                    ^
Language: C

#include <stdio.h>
int main(){
   int a,c=0;
   int k[a];
   for(a=1; a<=a(a-1)/2; a++){
       printf("%d",k[a]);
      c=c+k[a];
   }
  
   printf("%d",c);
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:16: error: called object 'a' is not a function or function pointer
    5 |    for(a=1; a<=a(a-1)/2; a++){
      |                ^
main.c:3:8: note: declared here
    3 |    int a,c=0;
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: expected ';' before 'cout'
   25 |   ans= ans*0.5
      |               ^
      |               ;
   26 | 
   27 |  cout<<ans<<endl;
      |  ~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:14:12: error: lvalue required as left operand of assignment
   14 |   d[i]*d[j]=z;
      |            ^
main.c:18:1: error: expected declaration or statement at end of input
   18 | }
      | ^
main.c:18:1: error: expected declaration or statement at end of input
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:8:7: error: 'n' undeclared (first use in this function)
    8 |   for(n=0;n<=N;n++){
      |       ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:21: error: expected ';' before 'n'
    9 |     scanf("%d",d[n])
      |                     ^
      |                     ;
   10 |       n++;}
      |       ~              
main.c:14:12: error: lvalue required as left operand of assignment
   14 |   d[i]*d[j]=z;
      |            ^
main.c:18:1: error: expected declaration or statement at end of input
   18 | }
      | ^
main.c:18:1: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
int main()
{
  int N,i,j,x,y,z;
  scanf("%d",&N);
  char d[N];
  
  d[i]=x:
  d[j]=y;
  
  z=x*y;
  printf("%d \n",z);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected ';' before ':' token
    8 |   d[i]=x:
      |         ^
      |         ;
Language: C++

n = int(input())
d = list(map(int,input().split()))
i = 0
j = 1
heal = 0
for i in range(n-1):
  for j in range(n):
    if ( i < j):
      heal = heal + d[i] * d[j]
      j += 1
    else:
      pass
  i +=1
  j +=1
print(heal)

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

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


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '<=' token
   11 |   for(int j=i+1,j<=n;++j)
      |                  ^~
      |                  ;
a.cc:11:18: error: expected primary-expression before '<=' token
   11 |   for(int j=i+1,j<=n;++j)
      |                  ^~
Language: C++

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

int n,a[101];
int ret;
main()
{
 cin>>n;
  for(int i=1;i<=n;++i) cin>>a[i];
  for(int i=1;i<=n-1;++i)
  for(int j=i+1,j<=n;++j)
  {
    ret+=a[i]*a[j];
  }
  cout<<ret
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '<=' token
   11 |   for(int j=i+1,j<=n;++j)
      |                  ^~
      |                  ;
a.cc:11:18: error: expected primary-expression before '<=' token
   11 |   for(int j=i+1,j<=n;++j)
      |                  ^~
a.cc:15:12: error: expected ';' before '}' token
   15 |   cout<<ret
      |            ^
      |            ;
   16 | }
      | ~
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];
  }
  int cost=0;
  for(int i=0;i<n;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      
        cost=cost+arr[i]*arr[j];
      
    }
    
  }
  cout<<cost<<endl;
   return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: 'arr' was not declared in this scope
   18 |         cost=cost+arr[i]*arr[j];
      |                   ^~~
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];
  }
  int cost=0;
  for(int i=0;i<n;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      
        cost=cost+arr[i]*arr[j]
      
    }
    
  }
  cout<<cost<<endl;
   return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: 'arr' was not declared in this scope
   18 |         cost=cost+arr[i]*arr[j]
      |                   ^~~
Language: C

#include <stdio.h>

int main(void)
{
  int N;
  int d[N];
  int i;
  
  scanf("%d",&N);
  
  for(i = 0;i <= N;i++){
	scanf("%d",d[i]);
  }
   for((i = 0;i <= N;i++)){
  printf("%d\n",( d[i] * d[i + 1]) / 2);
}
  return 0;
}
 

Compiler output:
main.c: In function 'main':
main.c:14:14: error: expected ')' before ';' token
   14 |    for((i = 0;i <= N;i++)){
      |        ~     ^
      |              )
main.c:14:26: error: expected ';' before ')' token
   14 |    for((i = 0;i <= N;i++)){
      |                          ^
      |                          ;
main.c:14:26: error: expected expression before ')' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int a=0;
  for (int i = 0; i < N; i++) {
    for (int j = i+1; j < N; j++) {
      a+=vec.at(i)*vec.at(j)
    }
  }
  cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'N'
    6 |   cin N;
      |      ^~
      |      ;
a.cc:14:29: error: expected ';' before '}' token
   14 |       a+=vec.at(i)*vec.at(j)
      |                             ^
      |                             ;
   15 |     }
      |     ~
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:13:3: error: expected declaration or statement at end of input
   13 |   }
      |   ^
Language: C++

include <bits/stdc++.h>
using namespace std;
int main(){
  int n, a[55];
  int 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 += i * j;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | 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:13:3: error: 'cout' was not declared in this scope
   13 |   cout<<ans<<endl;
      |   ^~~~
a.cc:13:14: error: 'endl' was not declared in this scope
   13 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

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

Compiler output:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main() {
    int n;
    std::cin >> n;
    int d[n];
    for(int i=0; i<n; i++) std::cin >> d[i];
    
    int ans;
  
    for (int i=0; i<n; i++) {
    	for (int j=i; j<n; j++) {
        	t = a[i]*a[j]
            ans += t
        }
    }
  
    cout << ans << endl;
      
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 't' was not declared in this scope
   13 |                 t = a[i]*a[j]
      |                 ^
a.cc:13:21: error: 'a' was not declared in this scope
   13 |                 t = a[i]*a[j]
      |                     ^
a.cc: At global scope:
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main() {
    int n;
    std::cin >> n;
    int d[n];
    for(int i=0; i<n; i++) std::cin >> d[i];
    
    int ans:
  
    for (int i=0; i<n; i++) {
    	for (int j=i; j<n; j++) {
        	t = a[i]*a[j]
            ans += t
        }
    }
  
    cout << ans << endl;
      
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected initializer before ':' token
    9 |     int ans:
      |            ^
a.cc:11:19: error: 'i' was not declared in this scope
   11 |     for (int i=0; i<n; i++) {
      |                   ^
a.cc:18:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     cout << ans << endl;
      |             ^~~
      |             abs
a.cc: At global scope:
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: Java

import java.util.*;

public class Main{
  pubic static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    int[] d=new int[N];
    for(int i=0;i<N;i++){
      d[i]=sc.nextInt();
    }
    int counter=0;
    int answer=0;
    while(counter<N){
      for(int i=0;i<N-1;i++){
        answer=answer+d[i]*d[i+1];
      }
      counter++;
    }
    System.out.println(answer);
  }
}

Compiler output:
Main.java:4: error: <identifier> expected
  pubic static void main(String[] args){
       ^
1 error
Language: C++

#include <iostream>
#include <malloc.h>
int main()
{
	
	int n;
	scanf_s("%d", &n);
	
	int* x = (int*)malloc(sizeof(int)*n);
	for (int m = 0; m < n; m++) {
		scanf_s("%d", x + m);
	}
	int rec = 0;
	for (int k = 0; k < n; k++) {
		for (int l = k; l < n; l++) {
			rec += (*(x + k))*(*(x+l));
		}
		rec -= *(x+k)*(*(x + k));
	}
	printf("%d", rec);
	/*
	for (int k = 1; k <= n; k++) {
		int h = 0;
		while (1) {
			if (k == *(x + h)) {
				printf("%d ", h + 1);
				break;
			}
				h++;
		}
	}
	*/
	free(x);
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    7 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<bits/stdc++.h>
using nqmespace std;
int main(){
  int n;
  cin >> n;
  int sum=0;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >>a[i];
    sum+=a[i];
  }
  int ans =0;
  for(int i=0;i<n;i++)ans+=(sum-a[i])*a[i];
  ans/=2;
  cout << ans;
}
     

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nqmespace'
    2 | using nqmespace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   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:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> a(n);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/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:10: error: expected primary-expression before 'int'
    7 |   vector<int> a(n);
      |          ^~~
a.cc:9:11: error: 'a' was not declared in this scope
    9 |     cin >>a[i];
      |           ^
a.cc:13:33: error: 'a' was not declared in this scope
   13 |   for(int i=0;i<n;i++)ans+=(sum-a[i])*a[i];
      |                                 ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout << ans;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

//
// pch.cpp
//

#include "pch.h"
#include <stdio.h>

int main(void) {
	int n = 0;

	scanf("%d", &n);

	int d[n];

	for (int i = 0;i < n;i++) {
		scanf("%d", d[n]);
	}

	int sum = 0;


	//1番目と2番目-n番目のせき
	//2番目と3番目-n番目のせき
	//3番目と4番目以降
	//m番目とm+1番目以降の積
	//...
	//n-1番目とn番目の積
	//nになったらおわり
	for (int i = 0;i < n;i++) {
		for (int j = i + 1;j < n;j++) {
			sum = sum + d[i] * d[j];
		}
	}
	printf("%d", sum);

}


Compiler output:
main.c:5:10: fatal error: pch.h: No such file or directory
    5 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
usin namespace std;
int main(){
  int n,all=0;
  cin>>n;
  vector<int> d(n);
  for(int i=0;i<n;i++){
    cin>>d.at(i);
  }
  for(int i;i<n;i++){
    for(int i2;i2<n;i2++){
      all+=d.at(i)*d.at(i2);
    }
  }
  cout<<all<<endl;
}


Compiler output:
a.cc:2:1: error: 'usin' does not name a type
    2 | usin namespace std;
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> d(n);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> d(n);
      |          ^~~
a.cc:8:10: error: 'd' was not declared in this scope
    8 |     cin>>d.at(i);
      |          ^
a.cc:12:12: error: 'd' was not declared in this scope
   12 |       all+=d.at(i)*d.at(i2);
      |            ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<all<<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:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<all<<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<iostream>
using namespace std;
int main()
{
  int i,n;
  cin>>n;
  int A[n],sum=0;
  for(i=0;i<n;i++)
  {
    cin>>A[i];
  }
  int j,k;
  for(k=1;k<n;k++)
  {
    for(j=0;j<k;j++)
    {
      sum=sum+A[k]*A[j];
    }
  }
  cout<<sum;
}
  return 0;


Compiler output:
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
Language: C++

#include <bits/stdc++.h>
usin namespace std;
int main(){
  int n,all=0;
  cin>>n;
  vector<int> d(n);
  for(int i=0;i<n;i++){
    cin>>d.at(i);
  }
  for(int i;i<n;i++){
    for(int i2;i2<n;i2++){
      all+=d.at(i)*d.at(i2);
    }
  }
  cout<<all<endl;
}

Compiler output:
a.cc:2:1: error: 'usin' does not name a type
    2 | usin namespace std;
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> d(n);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> d(n);
      |          ^~~
a.cc:8:10: error: 'd' was not declared in this scope
    8 |     cin>>d.at(i);
      |          ^
a.cc:12:12: error: 'd' was not declared in this scope
   12 |       all+=d.at(i)*d.at(i2);
      |            ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<all<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:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<all<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 <bits/stdc++.h>
using namespace std;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:43: error: expected ';' before '}' token
   14 |             sum += takoyaki[i]*takoyaki[j]
      |                                           ^
      |                                           ;
   15 |         }
      |         ~