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

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

int main(){
  int n;
  double result = 0;
  
  cin >> n;
  vector<int> di(n);
  for(int i = 0; i < n; i++){
    cin >> di.at(i);
  }
  
  for(int i = 0; i < n; i++){
   for(int j = i+1; j < n: j++){
    result += di.at(i) * di.at(j); 
   }
  }
  
  cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   15 |    for(int j = i+1; j < n: j++){
      |                     ^
a.cc:15:26: error: found ':' in nested-name-specifier, expected '::'
   15 |    for(int j = i+1; j < n: j++){
      |                          ^
      |                          ::
a.cc:15:25: error: 'n' is not a class, namespace, or enumeration
   15 |    for(int j = i+1; j < n: j++){
      |                         ^
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
a.cc:17:5: error: expected ';' before '}' token
   17 |    }
      |     ^
      |     ;
   18 |   }
      |   ~  
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
a.cc:17:5: error: expected ')' before '}' token
   17 |    }
      |     ^
      |     )
   18 |   }
      |   ~  
a.cc:15:7: note: to match this '('
   15 |    for(int j = i+1; j < n: j++){
      |       ^
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
Language: C++

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

int main(){
  int n;
  double result = 0;
  
  cin >> n;
  vector<int> di(n);
  for(int i = 0; i < n; i++){
    cin >> di.at(i);
  }
  
  for(int i = 0; i < n; i++){
   for(int j = 0; j < n: j++){
    result += di.at(i) * di.at(j); 
   }
  }
  
  cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   15 |    for(int j = 0; j < n: j++){
      |                   ^
a.cc:15:24: error: found ':' in nested-name-specifier, expected '::'
   15 |    for(int j = 0; j < n: j++){
      |                        ^
      |                        ::
a.cc:15:23: error: 'n' is not a class, namespace, or enumeration
   15 |    for(int j = 0; j < n: j++){
      |                       ^
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
a.cc:17:5: error: expected ';' before '}' token
   17 |    }
      |     ^
      |     ;
   18 |   }
      |   ~  
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
a.cc:17:5: error: expected ')' before '}' token
   17 |    }
      |     ^
      |     )
   18 |   }
      |   ~  
a.cc:15:7: note: to match this '('
   15 |    for(int j = 0; j < n: j++){
      |       ^
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before ')' token
   11 |     for(int i=0; i<N,i++){
      |                         ^
      |                         ;
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <math.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define rep+(i, a, b) for(int i = a; i < b; i++)
#define rep-(i, a, b) for(int i = a - 1; i >= b; i--)

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0, i = 0, j = 0;
  int num = 0, count = 0, ans = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  //char s1[200000], s2[200000], s3[200000];
  //string s1, s2, s3;
  
  cin >> a;
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
   
 for(i = 0; i < a; i++){
   for(j = i　+ 1; j < a; j++){
     b = a1[i] + a1[j];
     c += b;
    }
  }
  cout << c << endl;
}
  


Compiler output:
a.cc:17:9: warning: ISO C++11 requires whitespace after the macro name
   17 | #define rep+(i, a, b) for(int i = a; i < b; i++)
      |         ^~~
a.cc:18:9: warning: ISO C++11 requires whitespace after the macro name
   18 | #define rep-(i, a, b) for(int i = a - 1; i >= b; i--)
      |         ^~~
a.cc:18:9: warning: "rep" redefined
a.cc:17:9: note: this is the location of the previous definition
   17 | #define rep+(i, a, b) for(int i = a; i < b; i++)
      |         ^~~
a.cc:37:12: error: extended character 　 is not valid in an identifier
   37 |    for(j = i　+ 1; j < a; j++){
      |            ^
a.cc: In function 'int main()':
a.cc:37:12: error: 'i\U00003000' was not declared in this scope
   37 |    for(j = i　+ 1; j < a; j++){
      |            ^~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <math.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define rep+(i, a, b) for(int i = a; i < b; i++)
#define rep-(i, a, b) for(int i = a - 1; i >= b; i--)

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0, i = 0, j = 0;
  int num = 0, count = 0, ans = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  //char s1[200000], s2[200000], s3[200000];
  //string s1, s2, s3;
  
  cin >> a;
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
  for(i = 0; i < a; i++){
    for(j = i　+ 1; j < a; j++){
      b = a1[i] + a1[j];
      c += b;
    }
  }
  cout << c << endl;
}
  


Compiler output:
a.cc:17:9: warning: ISO C++11 requires whitespace after the macro name
   17 | #define rep+(i, a, b) for(int i = a; i < b; i++)
      |         ^~~
a.cc:18:9: warning: ISO C++11 requires whitespace after the macro name
   18 | #define rep-(i, a, b) for(int i = a - 1; i >= b; i--)
      |         ^~~
a.cc:18:9: warning: "rep" redefined
a.cc:17:9: note: this is the location of the previous definition
   17 | #define rep+(i, a, b) for(int i = a; i < b; i++)
      |         ^~~
a.cc:36:13: error: extended character 　 is not valid in an identifier
   36 |     for(j = i　+ 1; j < a; j++){
      |             ^
a.cc: In function 'int main()':
a.cc:36:13: error: 'i\U00003000' was not declared in this scope
   36 |     for(j = i　+ 1; j < a; j++){
      |             ^~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <math.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define rep+(i, a, b) for(int i = a; i < b; i++)
#define rep-(i, a, b) for(int i = a - 1; i >= b; i--)

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0, i = 0, j = 0;
  int num = 0, count = 0, ans = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  //char s1[200000], s2[200000], s3[200000];
  //string s1, s2, s3;
  
  cin >> a;
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
  for(i = 0; i < n; i++){
    for(j = i　+ 1; j < n; j++){
      b = a1[i] + a1[j];
      c += b;
    }
  }
  cout << c << endl;
}
  


Compiler output:
a.cc:17:9: warning: ISO C++11 requires whitespace after the macro name
   17 | #define rep+(i, a, b) for(int i = a; i < b; i++)
      |         ^~~
a.cc:18:9: warning: ISO C++11 requires whitespace after the macro name
   18 | #define rep-(i, a, b) for(int i = a - 1; i >= b; i--)
      |         ^~~
a.cc:18:9: warning: "rep" redefined
a.cc:17:9: note: this is the location of the previous definition
   17 | #define rep+(i, a, b) for(int i = a; i < b; i++)
      |         ^~~
a.cc:36:13: error: extended character 　 is not valid in an identifier
   36 |     for(j = i　+ 1; j < n; j++){
      |             ^
a.cc: In function 'int main()':
a.cc:35:18: error: 'n' was not declared in this scope
   35 |   for(i = 0; i < n; i++){
      |                  ^
a.cc:36:13: error: 'i\U00003000' was not declared in this scope
   36 |     for(j = i　+ 1; j < n; j++){
      |             ^~~
Language: C++


int main(){
  int n;
  double result = 0;
  
  cin >> n;
  vector<int> di(n);
  for(int i = 0; i < n; i++){
    cin >> di.at(i);
    if(i > 0){
     for(int j = 0; j < i; j++){
       result += di.at(i) * di.at(j);
     }
    }
  }
  
  cout << result << endl;
}

Compiler output:
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> di(n);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> di(n);
      |          ^~~
a.cc:9:12: error: 'di' was not declared in this scope; did you mean 'i'?
    9 |     cin >> di.at(i);
      |            ^~
      |            i
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << result << endl;
      |   ^~~~
a.cc:17:21: error: 'endl' was not declared in this scope
   17 |   cout << result << endl;
      |                     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'sncaf' was not declared in this scope; did you mean 'sscanf'?
    8 |     sncaf("%d",d+i);
      |     ^~~~~
      |     sscanf
Language: C++

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

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

#include<stdio.h>

int main(){
  int N,d[50],sum,i,j;
  sum = 0;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    sncaf("%d",d+i);
  }
  for(i=0;i<N;i++){
    for(j=i+1;j<N;j++){
      sum += d[i]*d[j]
    }
  }
  printf("%d",sum);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'sncaf' was not declared in this scope; did you mean 'sscanf'?
    8 |     sncaf("%d",d+i);
      |     ^~~~~
      |     sscanf
a.cc:12:23: error: expected ';' before '}' token
   12 |       sum += d[i]*d[j]
      |                       ^
      |                       ;
   13 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int l;
  cin >> l;
  int a[];
  for (int i = 0; i < l; i++){
    cin >> a[i];
  }
  
  int total = 0;
  for (int i = 0; i < l; i++){
    for (int j = 0; j < l; j++){
      total += a[i] * a[j];
    }
  }
  cout << total;
}

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

#include <stdio.h>

int main () {

 int N;
 int vet[100];
 int a,b;

 scanf("%d", &N);

 if (N==2){
   scanf("%d%d",&a,&b);
   printf("%d\n", a*b);
 }
 if (N != 2) {
   a= ( N*(N-1) )/2;
   b=0;
   for( int i=0; i<N; i++) {
     scanf("%d", &vet[i]);
   }

   for(int k=0; k < a ;k++){
     for(int j=k+1; j< N ;j++) {
        b += vet[k]*vet[j];
     }
   }
   /*for (int l=1; l<N; l++) {
      b -= vet[l]*vet[l];
   }*/
   printf("%d\n",b);
 }

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

#include<iostream>
using namespace std;

int main(){
 int N,D[100],a;
  int i,j;
  cin>>N;
  for(i=0;i<N;i++){
    cin>>D[i];
  }
  for(j=0;j<N-1;j++){
   for(i=j+1;i<n;i++){
     a +=D[j]*D[i];
   }
  }
  cout<<a<<endl;
}

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

#include<iostream>
using namespace std;

int main(){
 int N,D[100],a;
  int i,j;
  cin>>N;
  for(i=0;i<N;i++){
    cin>>D[i];
  }
  for(j=0;j<N-1;j++){
   for(i=0;i<n;i++){
     a +=D[j]*D[i];
   }
  }
  cout<<a<<endl;
}

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

#include<iostream>
using namespace std;

int main(){
 int N,D[100],a;
  int i,j;
  cin>>N;
  for(i=0;i<N;i++){
    cin>>D[i];
  }
  for(j=0;j<N-1;j++){
   for(i=0;i<n;i++){
     a +=D[j]*D[i];
   }
  }
  
}

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

#include<stdio.h>

int main(){
    int N,i,j;
    int ans = 0;

    scanf("%d", &N);

    int d[N];
    for ( i = 0; i < N; i++)
    {
        scanf("%d",&d[i]);
    }
    
    for ( i = 0; i < N-1; i++){
        for (j = i+1; i < N; j++)
        {
            ans+=N[i]*N[j];
        }
    }
    
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: invalid types 'int[int]' for array subscript
   18 |             ans+=N[i]*N[j];
      |                   ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |             ans+=N[i]*N[j];
      |                        ^
Language: C++

#include<stdio.h>

int main(){
    int N,i,j;
    int ans = 0;

    scanf("%d", &N);

    int d[N];
    for ( i = 0; i < N; i++)
    {
        scanf("%d",&d[i]);
    }
    
    for ( i = 0; i < N-1; i++){
        for (j = i+1; i < N; j++)
        {
            ans+=N[i]*N[j]
        }
    }
    
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: invalid types 'int[int]' for array subscript
   18 |             ans+=N[i]*N[j]
      |                   ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |             ans+=N[i]*N[j]
      |                        ^
Language: C++

#include<stdio.h>
i,j;
main(){
  int num,array[100],sum;
  scanf("%d",&num);
  for(;i<num;) scanf("%d",array[i++]);
  
  for(i=0;i<num-1;i++)
    for(j=i+1;j<num;)
      sum+=array[i]*array[j++];
  
  printf("%d",sum);
}

Compiler output:
a.cc:2:1: error: 'i' does not name a type
    2 | i,j;
      | ^
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:8: error: 'i' was not declared in this scope
    6 |   for(;i<num;) scanf("%d",array[i++]);
      |        ^
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<num-1;i++)
      |       ^
a.cc:9:9: error: 'j' was not declared in this scope
    9 |     for(j=i+1;j<num;)
      |         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'a' was not declared in this scope
    6 |   a[n];
      |   ^
Language: Java

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

Compiler output:
Main.java:8: error: not a statement
  for(int i = 0; i++; i<n){
                       ^
Main.java:13: error: not a statement
  for(int i = 0;i++;i<n){
                     ^
2 errors
Language: C++

#include<iostream>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin>>n;
  int d[n];
  for(int i=0;i<n;i++)
    cin>>d[i];
  for(int i=0;i<n;i++)
  {
    for(int j=i+1;j<n;j++){
      sum+=d[i]*d[j];
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'sum' was not declared in this scope
   16 |       sum+=d[i]*d[j];
      |       ^~~
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before '>' token
   12 |     for(int j=N-1,j>i,j--){
      |                    ^
      |                    ;
a.cc:12:20: error: expected primary-expression before '>' token
a.cc:12:26: error: expected ';' before ')' token
   12 |     for(int j=N-1,j>i,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 sum =0;
    int number[] = new int[N];
    for (int i=0;i<N;i++) {
      int[i] = sc.nextInt();
      for (j=0;i<j;j<N;j++) {
        int con = number[i]*number[j];
         int sum += con;
      }
    }
    System.out.println(sum);
  }
}
    

Compiler output:
Main.java:9: error: ']' expected
      int[i] = sc.nextInt();
          ^
Main.java:9: error: ';' expected
      int[i] = sc.nextInt();
           ^
Main.java:10: error: not a statement
      for (j=0;i<j;j<N;j++) {
                    ^
Main.java:10: error: ')' expected
      for (j=0;i<j;j<N;j++) {
                      ^
Main.java:10: error: ';' expected
      for (j=0;i<j;j<N;j++) {
                          ^
Main.java:12: error: ';' expected
         int sum += con;
                ^
Main.java:12: error: not a statement
         int sum += con;
                    ^
7 errors
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
   11 |   for(int i=0; i > N; i++){
      |   ^~~
a.cc:11:16: error: 'i' was not declared in this scope
   11 |   for(int i=0; i > N; i++){
      |                ^
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[] y = new int[n];

		for(int i=0; i<n; i++){
			y[i] = sc.nextInt();
		}

		int t = 0;
		for(int i=0; i<n; i++){
			for(int j=i++; j<n; j++){
				t += y[i] * y[j];
			}
		}
		System.out.pritnln(t);
	}

}


Compiler output:
Main.java:19: error: cannot find symbol
		System.out.pritnln(t);
		          ^
  symbol:   method pritnln(int)
  location: variable out of type PrintStream
1 error
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[] y = new int[n];

		for(int i=0; i<n; i++){
			y[i] = sc.nextInt();
		}

		int t = 0;
		for(int i=0; i<n; i++){
			for(int j=i++; j<n; j++){
				if(!(j = null)){
					t = y[i] * y[j];
				}
			}
		}
	}
}


Compiler output:
Main.java:16: error: incompatible types: <null> cannot be converted to int
				if(!(j = null)){
				         ^
Main.java:16: error: bad operand type int for unary operator '!'
				if(!(j = null)){
				   ^
2 errors
Language: Java

import java.util.Scanner;

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

		for(int i=0; i<n; i++){
			y[i] = sc.nextInt();
		}

		int t = 0;
		for(int i=0; i<n; i++){
			for(int j=i++; j<n; j++){
				if(j != null){
					t = y[i] * y[j];
				}
			}
		}
	}
}


Compiler output:
Main.java:16: error: bad operand types for binary operator '!='
				if(j != null){
				     ^
  first type:  int
  second type: <null>
1 error
Language: C

#include<stdio.h>
int main(){
  int c=0,e=0;
  scanf("%d \n",&n);
  for(a=0;a<n;a++)
  {
    scanf("%d",&d[a]);
  }
  for(b=0;b<n-1;b++){
    c=b+1;
    while(c<n){
      e+=d[b]*d[c];
      c=c+1;
    }
    
  }
  printf("%d",e);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: 'n' undeclared (first use in this function)
    4 |   scanf("%d \n",&n);
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:7: error: 'a' undeclared (first use in this function)
    5 |   for(a=0;a<n;a++)
      |       ^
main.c:7:17: error: 'd' undeclared (first use in this function)
    7 |     scanf("%d",&d[a]);
      |                 ^
main.c:9:7: error: 'b' undeclared (first use in this function)
    9 |   for(b=0;b<n-1;b++){
      |       ^
Language: C

int c=0,e=0;
  scanf("%d \n",&n);
  for(a=0;a<n;a++)
  {
    scanf("%d",&d[a]);
  }
  for(b=0;b<n-1;b++){
    c=b+1;
    while(c<n){
      e+=d[b]*d[c];
      c=c+1;
    }
    
  }
  printf("%d",e);
  return 0;
}

Compiler output:
main.c:2:9: error: expected declaration specifiers or '...' before string constant
    2 |   scanf("%d \n",&n);
      |         ^~~~~~~
main.c:2:17: error: expected declaration specifiers or '...' before '&' token
    2 |   scanf("%d \n",&n);
      |                 ^
main.c:3:3: error: expected identifier or '(' before 'for'
    3 |   for(a=0;a<n;a++)
      |   ^~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |   for(a=0;a<n;a++)
      |            ^
main.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |   for(a=0;a<n;a++)
      |                ^~
main.c:7:3: error: expected identifier or '(' before 'for'
    7 |   for(b=0;b<n-1;b++){
      |   ^~~
main.c:7:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 |   for(b=0;b<n-1;b++){
      |            ^
main.c:7:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 |   for(b=0;b<n-1;b++){
      |                  ^~
main.c:15:10: error: expected declaration specifiers or '...' before string constant
   15 |   printf("%d",e);
      |          ^~~~
main.c:15:15: error: expected declaration specifiers or '...' before 'e'
   15 |   printf("%d",e);
      |               ^
main.c:16:3: error: expected identifier or '(' before 'return'
   16 |   return 0;
      |   ^~~~~~
main.c:17:1: error: expected identifier or '(' before '}' token
   17 | }
      | ^
Language: C

 int c=0,e=0;
  scanf("%d \n",&n);
  for(a=0;a<n;a++)
  {
    scanf("%d",&d[a]);
  }
  for(b=0;b<n-1;b++){
    c=c+1;
    while(c<n){
      e+=d[b]*d[c];
      c=c+1;
    }
    c=b+1;
  }
  printf("%d",e);
  return 0;
}

Compiler output:
main.c:2:9: error: expected declaration specifiers or '...' before string constant
    2 |   scanf("%d \n",&n);
      |         ^~~~~~~
main.c:2:17: error: expected declaration specifiers or '...' before '&' token
    2 |   scanf("%d \n",&n);
      |                 ^
main.c:3:3: error: expected identifier or '(' before 'for'
    3 |   for(a=0;a<n;a++)
      |   ^~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |   for(a=0;a<n;a++)
      |            ^
main.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |   for(a=0;a<n;a++)
      |                ^~
main.c:7:3: error: expected identifier or '(' before 'for'
    7 |   for(b=0;b<n-1;b++){
      |   ^~~
main.c:7:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 |   for(b=0;b<n-1;b++){
      |            ^
main.c:7:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 |   for(b=0;b<n-1;b++){
      |                  ^~
main.c:15:10: error: expected declaration specifiers or '...' before string constant
   15 |   printf("%d",e);
      |          ^~~~
main.c:15:15: error: expected declaration specifiers or '...' before 'e'
   15 |   printf("%d",e);
      |               ^
main.c:16:3: error: expected identifier or '(' before 'return'
   16 |   return 0;
      |   ^~~~~~
main.c:17:1: error: expected identifier or '(' before '}' token
   17 | }
      | ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:5:11: error: conflicting types for 'd'; have 'int'
    5 |   int c=0,d=0;
      |           ^
main.c:4:7: note: previous declaration of 'd' with type 'int[n]'
    4 |   int d[n];
      |       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'a' was not declared in this scope
    6 |     cin >> a[i];
      |            ^
a.cc:9:10: error: 'a' was not declared in this scope
    9 |       s+=a[i]*a[j];
      |          ^
Language: C

#include <stdio.h>

int main(){
  int n;
  scnaf("%d",&n);
  int *ar;
  ar=malloc(sizeof(int)*n);
  for(int i=0;i<n;i++){
    scanf("%d",&ar[i]);}
  int sum=0;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      sum+=ar[i]*ar[j];}}
  printf("%d\n",sum);
}


Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |   scnaf("%d",&n);
      |   ^~~~~
      |   scanf
main.c:7:6: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    7 |   ar=malloc(sizeof(int)*n);
      |      ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:7:6: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    7 |   ar=malloc(sizeof(int)*n);
      |      ^~~~~~
main.c:7:6: note: include '<stdlib.h>' or provide a declaration of 'malloc'
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:8:12: error: expected identifier or '(' before '=' token
    8 |   for (int = 0; i < n; i++) scanf("%d", &a[i]);
      |            ^
main.c:8:17: error: 'i' undeclared (first use in this function)
    8 |   for (int = 0; i < n; i++) scanf("%d", &a[i]);
      |                 ^
main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<n;i++){
      |       ^
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=0;i<n;i++){
      |       ^
a.cc:14:9: error: 'j' was not declared in this scope
   14 |     for(j=i+1;j<n;j++){
      |         ^
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 S=0;
for(int i=0;i<N-1;i++){
for(int j=i+1;j<N;J++){
S = S + d[i]*d[j];
}
}
cout << S <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'J' was not declared in this scope
   13 | for(int j=i+1;j<N;J++){
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int d[N];
  int i, j;
  for(i=1; i<=N; i++){
    
    cin >> d[i];
  }
  for(i=1; i<=N-1;i++){
    for(j=i;j<=N;j++){
      kaifuku=d[i]*d[j];
      goukei+=kaifuku;
    }}
}

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

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int[] delicious = new int[n];
		int sum = 0;

		for(int i=0; i<n; i++){
			delicious[i] = scanner.nextInt();
		}

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

		System.out.print(sum);
	}
}


Compiler output:
Main.java:17: error: ';' expected
				sum += delicious[i] * delicious[j]
				                                  ^
1 error
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i : list) {
			for(int j : list) {
				if( i == j) {
					continue;
				}else {
					int one = list.get(i);
					int two = list.get(j);
					sum += one * two;
				}
			}
		}
	}
}


Compiler output:
Main.java:17: error: incompatible types: Object cannot be converted to int
		for(int i : list) {
		            ^
Main.java:18: error: incompatible types: Object cannot be converted to int
			for(int j : list) {
			            ^
Main.java:22: error: incompatible types: Object cannot be converted to int
					int one = list.get(i);
					                  ^
Main.java:23: error: incompatible types: Object cannot be converted to int
					int two = list.get(j);
					                  ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(Integer i : list) {
			for(Integet j : list) {
				if( i == j) {
					continue;
				}else {
					sum = i * j;
				}
			}
		}
	}
}


Compiler output:
Main.java:17: error: incompatible types: Object cannot be converted to Integer
		for(Integer i : list) {
		                ^
Main.java:18: error: cannot find symbol
			for(Integet j : list) {
			    ^
  symbol:   class Integet
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i = 0; i < list.size(); i++) {
			for(int j = 0; j < list.size(); j++) {
				if( i == j) {
					continue;
				}else {
					sum = list(i) * list(j);
				}
			}
		}
	}
}


Compiler output:
Main.java:22: error: cannot find symbol
					sum = list(i) * list(j);
					      ^
  symbol:   method list(int)
  location: class Main
Main.java:22: error: cannot find symbol
					sum = list(i) * list(j);
					                ^
  symbol:   method list(int)
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i = 0; i < list.size(); i++) {
			for(int j = 0; j < list.size(); j++) {
				if( !(i == j)) {
					sum += list.get(i) * list.get(j);
				}
			}
		}
	}
}


Compiler output:
Main.java:20: error: bad operand types for binary operator '*'
					sum += list.get(i) * list.get(j);
					                   ^
  first type:  Object
  second type: Object
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i = 0; i < list.size(); i++) {
			for(int j = 0; j < list.size(); j++) {
				if( !(i == j)) {
					int sum += list.get(i) * list.get(j);
				}
			}
		}
	}
}


Compiler output:
Main.java:20: error: ';' expected
					int sum += list.get(i) * list.get(j);
					       ^
Main.java:20: error: not a statement
					int sum += list.get(i) * list.get(j);
					                       ^
2 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i : list) {
			for(int j : list) {
				if( !(i == j)) {
					int sum += i * j;
				}
			}
		}
	}
}


Compiler output:
Main.java:20: error: ';' expected
					int sum += i * j;
					       ^
Main.java:20: error: not a statement
					int sum += i * j;
					             ^
2 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i : list) {
			for(int j : list) {
				if( !(i == j)) {
					int sum += list.get(i) * list.get(j);
				}
			}
		}
	}
}


Compiler output:
Main.java:20: error: ';' expected
					int sum += list.get(i) * list.get(j);
					       ^
Main.java:20: error: not a statement
					int sum += list.get(i) * list.get(j);
					                       ^
2 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i : list) {
			for(int j : list) {
				if( !(i == j)) {
					int sum += list.get(i) * list.get(j);
	}
}


Compiler output:
Main.java:20: error: ';' expected
					int sum += list.get(i) * list.get(j);
					       ^
Main.java:20: error: not a statement
					int sum += list.get(i) * list.get(j);
					                       ^
Main.java:22: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List list = new ArrayList<>();
		
		int sum = 0;
		
		int takoyaki = sc.nextInt();
		
		for(int i = 1; i <= takoyaki; i++) {
			int delicious = sc.nextInt();
			list.add(delicious);
		}
		
		for(int i : list) {
			for(int j : lsit) {
				if( !(i == j)) {
					int sum += list.get(i) * list.get(j);
	}
}


Compiler output:
Main.java:20: error: ';' expected
					int sum += list.get(i) * list.get(j);
					       ^
Main.java:20: error: not a statement
					int sum += list.get(i) * list.get(j);
					                       ^
Main.java:22: error: reached end of file while parsing
}
 ^
3 errors
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     cin >> d[i];
      |             ^
a.cc:12:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   ans = 0;
      |   ^~~
      |   abs
a.cc:15:15: error: invalid types 'int[int]' for array subscript
   15 |       ans += d[i]*d[j];
      |               ^
a.cc:15:20: error: invalid types 'int[int]' for array subscript
   15 |       ans += d[i]*d[j];
      |                    ^
Language: C++

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

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

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

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

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

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

#inculde<stdio.h>
int main()
{
	int N,S;
  int d[100];
  for(int i=0;i<N;i++)
  {
  	scanf("%d",&d[i]);
  }
  for(int i=1;i<=N-1;i++)
  {
  for(int j=i+1;j<=N;j++)
  {
  	S+=i*j
  }
  }
  printf("%d",S);
 
  
  
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inculde; did you mean #include?
    1 | #inculde<stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |         scanf("%d",&d[i]);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inculde<stdio.h>
main.c:8:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |         scanf("%d",&d[i]);
      |         ^~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:15: error: expected ';' before '}' token
   14 |         S+=i*j
      |               ^
      |               ;
   15 |   }
      |   ~            
main.c:17:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |   printf("%d",S);
      |   ^~~~~~
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

int main()
{
int N,k,s=0;
cin>>N;
vector<int>v;
  for(int i=0;i<N;i++)
  {
   	cin>>k;
    v.push_back(k);
  }
 for(i=0;i<N;i++)
 {
 	for(int j=i+1;j<N;j++)
    {
      s += (v[i]*v[j]);
    }
 }
return 0;
}

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

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

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

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

#include<bits/stdc++.h>
using namespace std;
 
int main (){
  int N,d,i,x,y,z,a;
  x=0;
  y=0;
  z=x-y;
  a=z/2;
  e=d*d;
  for(i=0;i<N;i++){
    cin>>d;
    x=+d;
    y=+e;
  }
  cout<<a<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'e' was not declared in this scope
   10 |   e=d*d;
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main (){
  int N,d,i,x,y,z,a;
  x=0;
  y=0;
  z=x-y;
  a=z/2;
  for(i=0;i<N;i++){
    cin>>d;
    x=+d;
    y=+d*d
  }
  cout<<a<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected ';' before '}' token
   13 |     y=+d*d
      |           ^
      |           ;
   14 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main (){
  int N,d,i,x,y,z,a;
  x=0;
  y=0;
  z=x-y;
  a=z/2;
  for(i=0;i<N;i++){
    cin>>d;
    x=+d;
    y=+a:a
  }
  cout<<a<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: found ':' in nested-name-specifier, expected '::'
   13 |     y=+a:a
      |         ^
      |         ::
a.cc:13:8: error: 'a' is not a class, namespace, or enumeration
   13 |     y=+a:a
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'reutrn' was not declared in this scope
   16 |   reutrn 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int N,sum;
	int vec[60];

	for (int i = 0; i < N; i++) {
		int d;
		vec[i] = d;
	}

	for (int i = 0; i < N; i++) {
		for (int j = 0; j < i; j++) {
			sum += vec[i] * vec[j];
	}

		cout << sum << endl;
}

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

#include<stdio.h>
#include<math.h>

//int cnt;
//int combination(int n, int m){
/*
N<1 or M<0 N<M
エラー処理がいる
*/
//呼び出しのカウント
//  cnt++;
//Overflow対策
/* nCm=nCn-mは同値の為計算量を減らす */
//  if(m>n-m) m=n-m;
//  if(m==0 || n==m) return 1;
//  return combination(n-1, m)+combination(n-1, m-1);
//}

//i = combination(3,2);
//printf("nCm=%d,cnt=%d",i,cnt);
//}

int main(){
  int i=0;
  int j=0;
  int recovery=0;
//  cnt=0;
  int N;
  scanf("%d", &N);
  int* d=new int[num]; //要素数がN個のint型の配列のためのメモリを動的に確保する

  for(i=0;i<N;i++){
    scanf("%d", &d[i]);
  }
  i=0;
  for(;i<N-1;i++){
    for(j=1;j<N;j++){
      recovery=recovery+d[i]*d[j];
    }
  }
  printf("%d",recovery);
  
  delete[] d;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: 'num' was not declared in this scope; did you mean 'enum'?
   30 |   int* d=new int[num]; //要素数がN個のint型の配列のためのメモリを動的に確保する
      |                  ^~~
      |                  enum
Language: C++

3
3 1 2#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
        ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

        int n, s = 0, a = 0;
        cin >> n;
        for (int i = 0; i < n; i++) {
                int x;
                cin >> x;
                a += s * x;
                s += x;
        }
        cout << a << "\n";

        return 0;
}


Compiler output:
a.cc:2:6: error: stray '#' in program
    2 | 3 1 2#include <bits/stdc++.h>
      |      ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3
      | ^
a.cc: In function 'int main()':
a.cc:9:9: error: 'ios_base' has not been declared
    9 |         ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
      |         ^~~~~~~~
a.cc:9:39: error: 'cin' was not declared in this scope
    9 |         ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
      |                                       ^~~
a.cc:9:51: error: 'cout' was not declared in this scope
    9 |         ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
      |                                                   ^~~~
Language: C++

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

int32_t main() {
 
	int n;	cin >> n;
	int a[n];
  	for(int x=0;x<n;x++)	cin >> a[x];
  	int sum = 0;
  	for(int x=0;x<n-1;x++){
      for(int y=x+1;y<n;y++){
        sum += (a[x] * a[y])
      }
    }
  cout << sum;
 
	return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:13:29: error: expected ';' before '}' token
   13 |         sum += (a[x] * a[y])
      |                             ^
      |                             ;
   14 |       }
      |       ~
Language: C++

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

int main()
{
int n,t,sum=0;
  cin>>n;
  vector<int> tnk;
  for(int i=0;i<n;i++)
  {
  cin>>t;
  tnj.push_back(t);
  }
  for(int i=0;i<n;i++)
    for(int j=i+1;j<n;j++)
    {
    sum+=tnk[i]*tnk[j]
    }
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'tnj' was not declared in this scope; did you mean 'tnk'?
   13 |   tnj.push_back(t);
      |   ^~~
      |   tnk
a.cc:18:23: error: expected ';' before '}' token
   18 |     sum+=tnk[i]*tnk[j]
      |                       ^
      |                       ;
   19 |     }
      |     ~