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



int main()
{
	using namespace std;
	int N,M;

	cin >> N >> M;


	int result = N * (N - 1) / 2 + M * (M - 1) / 2;

	cout << result;
	return 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> N >> M;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << result;
      |         ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

  int main() {
  int N,M;
  for(int i=0;i<N-1;i++){
   int s=i+i+1;
  }
  
 for(int i=0;i<M-1;I++){
   int t=i+i+1;
 }
  cout<< (s+t)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'I' was not declared in this scope
   10 |  for(int i=0;i<M-1;I++){
      |                    ^
a.cc:13:11: error: 's' was not declared in this scope
   13 |   cout<< (s+t)<<endl;
      |           ^
a.cc:13:13: error: 't' was not declared in this scope
   13 |   cout<< (s+t)<<endl;
      |             ^
Language: C++

#include
using namespace
  int main() {
  int N,M;
  for(int i=0;i<N-1;i++){
   int s=i+i+1;
  }
  
 for(int i=0;i<M-1;I++){
   int t=i+i+1;
 }
  cout<< (s+t)<<endl;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc:3:3: error: expected identifier before 'int'
    3 |   int main() {
      |   ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 |   int main() {
      |   ~~~           
a.cc: In function 'int main()':
a.cc:9:20: error: 'I' was not declared in this scope
    9 |  for(int i=0;i<M-1;I++){
      |                    ^
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout<< (s+t)<<endl;
      |   ^~~~
a.cc:12:11: error: 's' was not declared in this scope
   12 |   cout<< (s+t)<<endl;
      |           ^
a.cc:12:13: error: 't' was not declared in this scope
   12 |   cout<< (s+t)<<endl;
      |             ^
a.cc:12:17: error: 'endl' was not declared in this scope
   12 |   cout<< (s+t)<<endl;
      |                 ^~~~
Language: C++

using System;

class Program{
	static void Main(){
    	decimal d=decimal.Parse(Console.ReadLine());
      	Console.WriteLine(d*d*d/27.0m);
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:8:2: error: expected ';' after class definition
    8 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:5:9: error: 'decimal' was not declared in this scope
    5 |         decimal d=decimal.Parse(Console.ReadLine());
      |         ^~~~~~~
a.cc:6:9: error: 'Console' was not declared in this scope
    6 |         Console.WriteLine(d*d*d/27.0m);
      |         ^~~~~~~
a.cc:6:27: error: 'd' was not declared in this scope
    6 |         Console.WriteLine(d*d*d/27.0m);
      |                           ^
a.cc:6:33: error: unable to find numeric literal operator 'operator""m'
    6 |         Console.WriteLine(d*d*d/27.0m);
      |                                 ^~~~~
Language: C

#include <stdio.h>
int main(){
  
int N;
int M;
int sum;
scanf("%d", &N);
scanf("%d", &M);
if(N!=0 && M!=0){
for(int i=0; i<N-1; i++){
  N*=N-1;
  M*=M-1;
}
sum = N/2 + M/2;
print("%d", sum);
}else{
  sum=0;
  print("%d", sum);
}

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   15 | print("%d", sum);
      | ^~~~~
      | printf
Language: C

#include <stdio.h>
int main(){
  
int N;
int M;
int sum;
scanf("%d", &N);
scanf("%d", &M);
if(N!=0 && M!=0){
for(int i=0; i<N-1; i++){
  N*=N-1;
  M*=M-1;
}
sum = N/2 + M/2;
print("%d", sum);
}else{
  sum=0;
  print("%d", sum);
}

}


Compiler output:
main.c: In function 'main':
main.c:15:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   15 | print("%d", sum);
      | ^~~~~
      | printf
Language: C

#include<stdio.h>
#include<conio.h>
void main()
{
  int n,m,p=0;
  scanf("%d %d",&n,&m);
  p=(n*(n-1)/2)+(m*(m-1)/2);
  printf("%d",p);
  return;
}

Compiler output:
main.c:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
int main(void){
  
int N;
int M;
int sum;
scanf("%d", &N);
scanf("%d", &M);
if(N!=0 && M!=0){
for(int i=0; i<N-1; i++){
  N*=N-1;
  M*=M-1;
}
sum = N/2 + M/2;
print("%d", sum);
}else{
  sum=0;
  print("%d", sum);
}

}


Compiler output:
main.c: In function 'main':
main.c:15:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   15 | print("%d", sum);
      | ^~~~~
      | printf
Language: C++

#include <iostream>
using namespace std;

int main( ) 
{
	int a,b,tmp;
	
	cin>>a>>b;
	
	tmp=a;
	a=b;
	b=tmp;
	
	cout<<a<<b;
	return 0；
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   15 |         return 0；
      |                ^~~
a.cc:15:19: error: expected ';' before '}' token
   15 |         return 0；
      |                   ^
      |                   ;
   16 | }
      | ~
Language: C

#include (stdio.h)
int main(void){
  
int N;
int M;
int sum;
scanf("%d", &N);
scanf("%d", &M);
if(N!=0 && M!=0){
for(int i=0; i<N-1; i++){
  N*=N-1;
  M*=M-1;
}
sum = N/2 + M/2;
print("%d", sum);
}else{
  sum=0;
  print("%d", sum);
}

}


Compiler output:
main.c:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include (stdio.h)
      |          ^
main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 | scanf("%d", &N);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include (stdio.h)
main.c:7:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 | scanf("%d", &N);
      | ^~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:1: error: implicit declaration of function 'print' [-Wimplicit-function-declaration]
   15 | print("%d", sum);
      | ^~~~~
Language: C++

    #include <stdio.h>
    int fact(int) 
    int main(void){
      int n, m, nc2, mc2;
      scanf("%d", &n);
      scanf("%d", &m);
      
      nc2=fact(n)/(fact(2)*fact(n-2));
      mc2=fact(m)/(fact(2)*fact(m-2));
      
      printf("%d", nc2+mc2);
      
      return 0;}
     
   	int fact(int n)
{
    int i,f=1;
    for(i=1;i<=n;i++)
    {
        f=f*i;
    }
    return f;
}

Compiler output:
a.cc:3:5: error: expected initializer before 'int'
    3 |     int main(void){
      |     ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
using Graph = vector<vector<int> >;

int main(){
  int N, M; cin >> N >> M;
  int sum = N*(N-1)/2 + M*(M-1)/2;
  cout << sum << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected '}' at end of input
   10 |   cout << sum << endl;
      |                       ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C

#include(stdio.h)
int main(void){
  
int N;
int M;
int sum;
scanf("%d", &N);
scanf("%d", &M);
if(N!=0 && M!=0){
for(int i=0; i<N-1; i++){
  N*=N-1;
  M*=M-1;
}
sum = N/2 + M/2;
print("%d", sum);
}else{
  sum=0;
  print("%d", sum);
}

}

Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include(stdio.h)
      |         ^
main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 | scanf("%d", &N);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include(stdio.h)
main.c:7:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 | scanf("%d", &N);
      | ^~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:1: error: implicit declaration of function 'print' [-Wimplicit-function-declaration]
   15 | print("%d", sum);
      | ^~~~~
Language: C

#include<stdio.h>
int main()
{
  int N,M,A;
  scanf("%d %d", N, M);
  
  A = (N*N-N)+M*M-M))/2;
  
  printf("%d", A);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:20: error: expected ';' before ')' token
    7 |   A = (N*N-N)+M*M-M))/2;
      |                    ^
      |                    ;
main.c:7:20: error: expected statement before ')' token
main.c:7:21: error: expected statement before ')' token
    7 |   A = (N*N-N)+M*M-M))/2;
      |                     ^
main.c:7:22: error: expected expression before '/' token
    7 |   A = (N*N-N)+M*M-M))/2;
      |                      ^
Language: Java

    import java.io.*;
    public class Mai
    {
      public static void main(String args[])throws IOException
      {
        String s,s1="",s2="",s3="",s4="",s5=""; 
        int i,k=0,j=0,l,l1,l2;
        BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
        s=input.readLine();
        l=s.length();
        l1=(l-1)/2;
        l2=(l+3)/2;
        s2=s.substring(0,l1);
        s3=s.substring(l2-1,l);
        for(i=0;i<l;i++)
        {
            s1=s.charAt(i)+s1;
        }
        for(i=0;i<l2;i++)
        {
          if(j<l1)
          {
            s4=s2.charAt(j)+s4;
          }
          if(k<l2-2)
          {
            s5=s3.charAt(k)+s5;
          }
      //    System.out.println(s4+" "+s5);
          j++;
          k++;
        }
        if(s.equals(s1) && s2.equals(s4) && s3.equals(s5))
          System.out.println("Yes");
        else
          System.out.println("No");
      }
    }

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

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

int main()
{
	int i,x;
	int a[100];
    cin >> a[100];
	int b[100]
	cin>>b[100];
	{
	
    for(i=a[0];i<=a[100];i++)
    {
        scanf("%d", &i);
        break;
    }
    for(x=b[0];x<=b[100];x++)
    {
    	scanf("%d", &x);
        break;
    }
    int s=i+x,m;
    if(s%2==0)
    m++;
    else
    m+0;
    }   
    cout<<m;
  	return 0;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include,bits/stdc++.h
      |         ^
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> a[100];
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include,bits/stdc++.h
a.cc:10:9: error: expected initializer before 'cin'
   10 |         cin>>b[100];
      |         ^~~
a.cc:15:9: error: 'scanf' was not declared in this scope
   15 |         scanf("%d", &i);
      |         ^~~~~
a.cc:18:11: error: 'b' was not declared in this scope
   18 |     for(x=b[0];x<=b[100];x++)
      |           ^
a.cc:20:9: error: 'scanf' was not declared in this scope
   20 |         scanf("%d", &x);
      |         ^~~~~
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout<<m;
      |     ^~~~
a.cc:29:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:11: error: 'm' was not declared in this scope
   29 |     cout<<m;
      |           ^
Language: C++

#include "pch.h"
#include <iostream>
#include "math.h"




int main()
{
	using namespace std;
	int N,M;

	
	scanf_s("%d", &N);
	scanf_s("%d", &M);

	int result = N * (N - 1) / 2 + M * (M - 1) / 2;

	printf("%d", result);
	return 1;
}


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

#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int combination(int a,int b);
  int combination(int c,int b);
  int N,M;
  cin >> N >> M;
  
  if(N>=2 && M>=2) {
    a==N;
    b==2;
    c==M;  
  cout << combination(N,2)+combination(M,2) << endl;
  }
  else if(N>=2 && M<2){
    a==N;
    b==2;
    
    cout << combination(N,2) << endl;}
  else if (N<2 && M>=2) {
    
    b==2;
    c==M;
    cout << combination(M,2) << endl;}
  else if (N<2 && M>=2) {
    cout << 0 << endl;}
  }
     


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'a' was not declared in this scope
   10 |     a==N;
      |     ^
a.cc:11:5: error: 'b' was not declared in this scope
   11 |     b==2;
      |     ^
a.cc:12:5: error: 'c' was not declared in this scope
   12 |     c==M;
      |     ^
a.cc:16:5: error: 'a' was not declared in this scope
   16 |     a==N;
      |     ^
a.cc:17:5: error: 'b' was not declared in this scope
   17 |     b==2;
      |     ^
a.cc:22:5: error: 'b' was not declared in this scope
   22 |     b==2;
      |     ^
a.cc:23:5: error: 'c' was not declared in this scope
   23 |     c==M;
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int combination(int a,int b);
  int combination(int c,int b);
  int N,M;
  cin >> N >> M;
  
  if(N>=2 && M>=2) {
    a==N;
    b==2;
    c==M;  
  cout << combination(N,2)+combination(M,2) << endl;
  }
  else if(N>=2 && M<2){
    a==N;
    b==2;
    
    cout << combination(N,2) << endl;}
  else if (N<2 && M>=2) {
    
    b==2;
    c==M;
    cout << combination(M,2) << endl;}
  else if (N<2 && M>=2) {
    cout << 0 << endl;}
  }
     


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'a' was not declared in this scope
   10 |     a==N;
      |     ^
a.cc:11:5: error: 'b' was not declared in this scope
   11 |     b==2;
      |     ^
a.cc:12:5: error: 'c' was not declared in this scope
   12 |     c==M;
      |     ^
a.cc:16:5: error: 'a' was not declared in this scope
   16 |     a==N;
      |     ^
a.cc:17:5: error: 'b' was not declared in this scope
   17 |     b==2;
      |     ^
a.cc:22:5: error: 'b' was not declared in this scope
   22 |     b==2;
      |     ^
a.cc:23:5: error: 'c' was not declared in this scope
   23 |     c==M;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std
 int pairs_sum(int n,int m)
{
  if(n<2)
    return 0;
  int ans=1;
  r=min(m,n-m);
  for(int i=0;i<m;i++)
  {
    ans=ans*(n-i)/(i+1);
  }
  return ans;
}
int main()
{int N,M;
 cin>>N;
 cin>>M;
 int output=pairs_sum(N,M);

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 |  int pairs_sum(int n,int m)
      |  ~~~                
a.cc: In function 'int pairs_sum(int, int)':
a.cc:8:3: error: 'r' was not declared in this scope
    8 |   r=min(m,n-m);
      |   ^
a.cc: In function 'int main()':
a.cc:19:28: error: expected '}' at end of input
   19 |  int output=pairs_sum(N,M);
      |                            ^
a.cc:16:1: note: to match this '{'
   16 | {int N,M;
      | ^
Language: C++


using namespace std;

int main()
{
    int n,m;
     cin>>n>>m;
  return (n*(n-1))/2 + (m*(m-1))/2 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'cin' was not declared in this scope
    7 |      cin>>n>>m;
      |      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 |
Language: C

#include<stdio.h>
int main(void)
{
  int N,M,A;
  scanf("%d %d", N, M);
  if (N*M != 0)
    A = (N*(N-1)+M*(M-1))/2;
    break;
  else if (N == 0)
    A = M*(M-1)/2;
    break;
  else
    A = N*(N-1)/2;
    break;
      
  printf("%d", A);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: break statement not within loop or switch
    8 |     break;
      |     ^~~~~
main.c:9:3: error: 'else' without a previous 'if'
    9 |   else if (N == 0)
      |   ^~~~
main.c:11:5: error: break statement not within loop or switch
   11 |     break;
      |     ^~~~~
main.c:12:3: error: 'else' without a previous 'if'
   12 |   else
      |   ^~~~
main.c:14:5: error: break statement not within loop or switch
   14 |     break;
      |     ^~~~~
Language: C++

#include <stdio.h>
int main(void){
  int n, m, nc2, mc2;
  scanf("%d", &n);
  scanf("%d", &m);
  
  nc2=fact(n)/(fact(2)*fact(n-r));
  mc2=fact(m)/(fact(2)*fact(m-r));
  
  printf("%d", nc2+mc2);
  
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'fact' was not declared in this scope
    7 |   nc2=fact(n)/(fact(2)*fact(n-r));
      |       ^~~~
a.cc:7:31: error: 'r' was not declared in this scope
    7 |   nc2=fact(n)/(fact(2)*fact(n-r));
      |                               ^
Language: C++

#include<iostream.h >
using namespace std;

int main()
{
    int n,m;
     cin>>n>>m;
  return (n*(n-1))/2 + (m*(m-1))/2 ;
}

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

#include<stdio.h>
int main()
{
  int N,M,A;
  scanf("%d %d", N, M);
  if (N*M != 0)
    A = (N*(N-1)+M*(M-1))/2;
    break;
  else if (N == 0)
    A = M*(M-1)/2;
    break;
  else
    A = N*(N-1)/2;
    break;
      
  printf("%d", A);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: break statement not within loop or switch
    8 |     break;
      |     ^~~~~
main.c:9:3: error: 'else' without a previous 'if'
    9 |   else if (N == 0)
      |   ^~~~
main.c:11:5: error: break statement not within loop or switch
   11 |     break;
      |     ^~~~~
main.c:12:3: error: 'else' without a previous 'if'
   12 |   else
      |   ^~~~
main.c:14:5: error: break statement not within loop or switch
   14 |     break;
      |     ^~~~~
Language: C

#include<stdio.h>
int main()
{
  int N,M,A;
  scanf("%d %d", N, M);
  if (N*M != 0)
    A = (N*(N-1)+M*(M-1))/2;
    break;
  else if (N == 0)
    A = M*(M-1)/2;
    break;
  else
    A = N*(N-1)/2;
    break
      
  printf("%d", A);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: break statement not within loop or switch
    8 |     break;
      |     ^~~~~
main.c:9:3: error: 'else' without a previous 'if'
    9 |   else if (N == 0)
      |   ^~~~
main.c:11:5: error: break statement not within loop or switch
   11 |     break;
      |     ^~~~~
main.c:12:3: error: 'else' without a previous 'if'
   12 |   else
      |   ^~~~
main.c:14:5: error: break statement not within loop or switch
   14 |     break
      |     ^~~~~
main.c:14:10: error: expected ';' before 'printf'
   14 |     break
      |          ^
      |          ;
   15 | 
   16 |   printf("%d", A);
      |   ~~~~~~
Language: C++

#include<bits/stdc++.h>
#define pf printf
#define sc(x) scanf("%d",&x);
#define scs(x) scanf("%s",x);
#define scl(x) scanf("%lld",&x);
#define rep(i,s,e) for(int i=s; i<=e; ++i)
#define dep(i,s,e) for(int i=s; i>=e; --i)
typedef long long ll;
using namespace std;
int main(){
	int n,m;
	sc(n);sc(m);
	pf("%d\n",n*(n-1)/2+m*(m-1)/2);2 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: expected ';' before '}' token
   13 |         pf("%d\n",n*(n-1)/2+m*(m-1)/2);2
      |                                         ^
      |                                         ;
   14 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int combination(int a,int b);
  int combination(int c,int b);
  int N,M;
  cin >> N >> M;
  
  if(N>=2 && M>=2) {
    a=N;
    b=2;
    c=M;  
  cout << combination(N,2)+combination(M,2) << endl;
  }
  else if(N>=2 && M<2){
    a=N;
    b=2;
    
    cout << combination(N,2) << endl;}
  else if (N<2 && M>=2) {
    
    b=2;
    c=M;
    cout << combination(M,2) << endl;}
  else if (N<2 && M>=2) {
    cout << 0 << endl;}
  }
     


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'a' was not declared in this scope
   10 |     a=N;
      |     ^
a.cc:11:5: error: 'b' was not declared in this scope
   11 |     b=2;
      |     ^
a.cc:12:5: error: 'c' was not declared in this scope
   12 |     c=M;
      |     ^
a.cc:16:5: error: 'a' was not declared in this scope
   16 |     a=N;
      |     ^
a.cc:17:5: error: 'b' was not declared in this scope
   17 |     b=2;
      |     ^
a.cc:22:5: error: 'b' was not declared in this scope
   22 |     b=2;
      |     ^
a.cc:23:5: error: 'c' was not declared in this scope
   23 |     c=M;
      |     ^
Language: C

int N=0;
int M=0;
int sum;
scanf("%d", &N);
scanf("%d", &M);
if(N!=0 && M!=0){
for(int i=0; i<N-1; i++){
  N*=N-1;
  M*=M-1;
}
sum = N/2 + M/2;
print("%d", sum);
}else{
  sum=0;
  print("%d", sum);
}

Compiler output:
main.c:4:7: error: expected declaration specifiers or '...' before string constant
    4 | scanf("%d", &N);
      |       ^~~~
main.c:4:13: error: expected declaration specifiers or '...' before '&' token
    4 | scanf("%d", &N);
      |             ^
main.c:5:7: error: expected declaration specifiers or '...' before string constant
    5 | scanf("%d", &M);
      |       ^~~~
main.c:5:13: error: expected declaration specifiers or '...' before '&' token
    5 | scanf("%d", &M);
      |             ^
main.c:6:1: error: expected identifier or '(' before 'if'
    6 | if(N!=0 && M!=0){
      | ^~
main.c:13:2: error: expected identifier or '(' before 'else'
   13 | }else{
      |  ^~~~
Language: C++

#include< iostream>
using namespace std;

int main()
{
    int n,m;
     cin>>n>>m;
  return (n*(n-1))/2 + (m*(m-1))/2 ;
}

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

#include<bits/std++.h>
using namespace std
 int pairs_sum(int n,int m)
{
  if(n<2)
    return 0;
  int ans=1;
  r=min(m,n-m);
  for(int i=0;i<m;i++)
  {
    ans=ans*(n-i)/(i+1);
  }
  return ans;
}
int main()
{int N,M;
 cin>>N;
 cin>>M;
 int output=pairs_sum(N,M);
}

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

/* 159 */
#include<bits/stdc++.h>
using namespace std;
int main ()
{
    int n,ans=0;
    cin>>n>>m;
    if(n>1) ans += (n*(n-1))/2; 
    if(m>1) ans += (m*(m-1))/2;
    cout<<ans;
    return 0;
}

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

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

int main()
{
    int n,m;
     cin>>n>>m;
  return (n*(n-1))/2 + (m*(m-1))/2 ;
}

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

#include<bits/stdc++.h>
using namespace std;
  
int main()
{
 int n,m;
 cin>>n>>m;
 int ans=((n*(n-1))/2)+(m(*m-1))/2;
  cout<<ans<<endl;
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: invalid type argument of unary '*' (have 'int')
    8 |  int ans=((n*(n-1))/2)+(m(*m-1))/2;
      |                           ^~
a.cc:8:31: error: 'm' cannot be used as a function
    8 |  int ans=((n*(n-1))/2)+(m(*m-1))/2;
      |                               ^
Language: C++

using namespace std;

int main(){
int n, m;
cin >> n;
cin >> m;
cout << (n*(n-1)/2+m*(m-1)/2) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: 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:7:1: error: 'cout' was not declared in this scope
    7 | cout << (n*(n-1)/2+m*(m-1)/2) << endl;
      | ^~~~
a.cc:7:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:34: error: 'endl' was not declared in this scope
    7 | cout << (n*(n-1)/2+m*(m-1)/2) << 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()
{
    int n,m;
    cin>>n>>m;
  int t=(n*(n-1))/2  +  (m*(m-1))/2;
    return t;
}

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;
 
int main() {
  int N;
  int M;
  cin >> N;
  cin >> M;
  if (N == 1) {
    N = 0;
  }
  else if (N == 0) {
    N = 0;
  }
  else if (N > 1) {
    for (int i = 1; i <= (N-1); i++) {
      (N-1) *= i;
    }
  }
  if (M == 1) {
    M = 0;
  }
  else if (M == 0) {
    M = 0;
  }
  else if (M > 1) {
    for (int l = 1; l <= (M-1); l++) {
      (M-1) *= l; 
    }
  }
  cout << (N-1) + (M-1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: lvalue required as left operand of assignment
   17 |       (N-1) *= i;
      |       ~~^~~
a.cc:28:9: error: lvalue required as left operand of assignment
   28 |       (M-1) *= l;
      |       ~~^~~
Language: C++

int main() {
  double L;
  cin>>L;
  double a = L/3;

  cout<<L*L*L/27<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>L;
      |   ^~~
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout<<L*L*L/27<<endl;
      |   ^~~~
a.cc:6:19: error: 'endl' was not declared in this scope
    6 |   cout<<L*L*L/27<<endl;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define ub upper_bound
    #define int long long
    #define vbe(sdk) sdk.begin(),sdk.end()
    #define pb push_back
    #define loop(i,a,b) for(int i=a;i<b;++i)
    #define rloop(i,a,b) for(int i=a;i>=b;--i)
    #define mp make_pair
    #define mod 1000000007
    #define p mod
    #define endl '\n'
    #define vvll vector<vector<int> >
    #define vll vector<int>
    #define mint map<int,int> 
    #define sz(x) (int)x.size()
    #define sll set<int>
    #define pll pair<int,int>
    #define F first
    #define S second
    #define pi 3.14159265358979323846
    using namespace std;
int power(int x, int y, int p) 
{ 
    int res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or 
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
int modInverse(int n, int p) 
{ 
    return power(n, p-2, p); 
} 
  
// Returns nCr % p using Fermat's little 
// theorem. 
int nCr(int n, int r) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    int fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
} 
  
    signed main()
    {
        int n,m;
        cin>>n>>m;
        if(n>1 && m>1)
        {
            cout<<nCr(n,2)*nCr(m,0)+nCr(n,0)*nCr(m,2)<<"\n";
        }
        else if(n>1)
        {
            cout<<nCr(n,2)<<"\n";
        }
        else if(m>1)
        {
            cout<<nCr(m,2)<<"\n";
        }
        else
        {
            cout<<"0\n";
        }
        

        

        return 0;
    }
 
 

Compiler output:
a.cc:11:17: error: expected ',' or '...' before numeric constant
   11 |     #define mod 1000000007
      |                 ^~~~~~~~~~
a.cc:12:15: note: in expansion of macro 'mod'
   12 |     #define p mod
      |               ^~~
a.cc:24:29: note: in expansion of macro 'p'
   24 | int power(int x, int y, int p)
      |                             ^
a.cc:11:17: error: expected ',' or '...' before numeric constant
   11 |     #define mod 1000000007
      |                 ^~~~~~~~~~
a.cc:12:15: note: in expansion of macro 'mod'
   12 |     #define p mod
      |               ^~~
a.cc:45:27: note: in expansion of macro 'p'
   45 | int modInverse(int n, int p)
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int combination(int a,int b);
  int N,M;
  cin >> N >> M;
  
  if(N>=2 && M>=2) {
    
  cout << combination(N,2)+combination(M,2) << endl;
  }
  else if(N>=2 && M<2){
    cout << combination(N,2) << endl;}
  else if (N<2 && M>=2) {
    cout << combination(M,2) << endl;}
  else if (N<2 && M>=2) {
    cout << 0 << endl;}
  }
     


Compiler output:
/usr/bin/ld: /tmp/ccO6wSlt.o: in function `main':
a.cc:(.text+0x4c): undefined reference to `combination(int, int)'
/usr/bin/ld: a.cc:(.text+0x5d): undefined reference to `combination(int, int)'
/usr/bin/ld: a.cc:(.text+0xa6): undefined reference to `combination(int, int)'
/usr/bin/ld: a.cc:(.text+0xea): undefined reference to `combination(int, int)'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;

public class MyClass {
    public static void main(String args[]) {
        Scanner sc = new Scaanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println( (n*(n-1))/2+(m*(m-1))/2 );
    }
}

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

#include  <bits/stdc++.h>
using namespace std; 
 
int main()
{
	int n,m;
	cin>>n>>m;
	int a[400],an=0,e[101],o[101];
	for(int i=1;i<=n;i++)
	{
		if(i%2==0;)
		{
		   if ( e[i-1]==0)
		   { 
		   	  e[i-1]=i;
		   }
		   else
		   {
	          e[i]=i;
		   }
		}
    }
	for(int i=1;i<=n;i++) 
	{
		for(int j=1;j<=m;j++)
		{
			if(n>m)
			{
			    a[n]=i+j;
			}
			else
			{
				a[m]=i+j; 
			}
		}
	}
	for(int i=1;i<=400;i++)
	{
		if(a[i]!=0)
		{
			if(a[i]%2==0)
			{
				an++;
			}
		}
	}
	cout<<an;
	return 0;
}   
			 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected primary-expression before ')' token
   11 |                 if(i%2==0;)
      |                           ^
Language: C++

int pairs_sum(int n,int m)
{
  if(n<2)
    return 0;
  int ans=1;
  r=min(m,n-m);
  for(int i=0;i<m;i++)
  {
    ans=ans*(n-i)/(i+1);
  }
  return ans;
}

Compiler output:
a.cc: In function 'int pairs_sum(int, int)':
a.cc:6:3: error: 'r' was not declared in this scope
    6 |   r=min(m,n-m);
      |   ^
a.cc:6:5: error: 'min' was not declared in this scope
    6 |   r=min(m,n-m);
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int combination(int N,int M);
  cin >> N >> M;
  
  if(N>=2 && M>=2) {
  cout << combination(N,2)+combination(M,2) << endl;
  }
  else if(N>=2 && M<2){
    cout << combination(N,2) << endl;}
  else if (N<2 && M>=2) {
    cout << combination(M,2) << endl;}
  else if (N<2 && M>=2) {
    cout << 0 << endl;}
  }
     


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

#include<iostream>
using namespace std;
int factorial
int main()
{
  int n,m;
  cin>>n>>m;
  int k;
  k=(n*(n-1))/2;
  int l;
  l=(m*(m-1))/2;
  
  int a=k+l;
  cout<<a;
  
}

Compiler output:
a.cc:4:1: error: expected initializer before 'int'
    4 | int main()
      | ^~~
Language: C++

from math import factorial
N,M = map(int,input().split())
if N <= 1:
    n_count = 0
else:
    n_count = factorial(N) / factorial(2) / factorial(N-2)
if M <= 1: 
    m_count = 0
else:
    m_count = factorial(M) / factorial(2) / factorial(M-2)



print(int(n_count+m_count))


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import factorial
      | ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
bool doixung(string s)
{
    for (int i=0; i<=s.length()/2; i++)
        if (s[i]!=s[s.length()-i-1])
            return 0;
    return 1;
}
 
int main()
{
    string s;
    getline(cin,s); 
    if (doixung(s))
        cout << "Yes";
    else
        cout << "No";
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected '}' at end of input
   21 |     return 0;
      |              ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^
Language: C++

#include<iostream>
#include<cstdio>
#include <string.h>
using namespace std;

int main() {
    int a, b, c, d, e;
    cin >> a >> b;
    a / 2 = c;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: lvalue required as left operand of assignment
    9 |     a / 2 = c;
      |     ~~^~~
Language: C++

#include <iostream>

using namespace std;

int cross(int a){
    for(int i = 1;i < a;i++){
      int b = 1;
      b *= i;
    }
    return b;
}

int main(){
    int n,m;
    cin >> n >> m;
    cout << cross(n)+cross(m) <<;
}
    
    

Compiler output:
a.cc: In function 'int cross(int)':
a.cc:10:12: error: 'b' was not declared in this scope
   10 |     return b;
      |            ^
a.cc: In function 'int main()':
a.cc:16:33: error: expected primary-expression before ';' token
   16 |     cout << cross(n)+cross(m) <<;
      |                                 ^
Language: C

#include<stdio.h>
int main()
{
  int N,M,A;
  scanf("%d %d", N, M);
  A = (N*(N-1)+M*(M-1))/2
  
  printf("%d", A);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:26: error: expected ';' before 'printf'
    6 |   A = (N*(N-1)+M*(M-1))/2
      |                          ^
      |                          ;
    7 | 
    8 |   printf("%d", A);
      |   ~~~~~~
Language: C

#include<stdio.h
int main()
{
  int N,M,A;
  scanf("%d %d", N, M);
  A = (N*(N-1)+M*(M-1))/2
  
  printf("%d", A);
return 0;
}

Compiler output:
main.c:1:17: error: missing terminating > character
    1 | #include<stdio.h
      |                 ^
main.c: In function 'main':
main.c:6:26: error: expected ';' before 'printf'
    6 |   A = (N*(N-1)+M*(M-1))/2
      |                          ^
      |                          ;
    7 | 
    8 |   printf("%d", A);
      |   ~~~~~~
Language: C++

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

int main(){
 int n,m;
 cin >> n >> m;
 
 if ((n + m) % 2 == 0){
   if (n % 2 == 0){
     cout << n * (n - 1) / 2 << endl;
   else {
     cout << m * (m - 1) / 2 << endl;
 }
   }
 }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:4: error: expected '}' before 'else'
   11 |    else {
      |    ^~~~
a.cc:9:19: note: to match this '{'
    9 |    if (n % 2 == 0){
      |                   ^
a.cc: At global scope:
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C

#include<stdio.h>
#define scanf scanf_s
int main()
{
	int n, m, s, sum = 1, i;
	scanf("%d %d", &n, &m);
	s = n + m;
	for (i = s-1; i <= s; i++)
		sum *= i;
	sum /= 2;
	printf("%d", sum - n * m);
}

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

#include<stdio.h>
int main()
{
  int N,M,a,b,i,count;
    scanf("%d %d"&N,&M);
  for(i=1;i<=N;i++)
  {
    scanf("%d",&a);
  }
  for(i=1;i<=M;i++)
  {
    scanf("%d",&b);
  }
  for(i=1;i<=(N+M);i++)
  {
    if((a+b)%2==0)
      count++;
  }
  printf("%d",count);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:18: error: invalid operands to binary & (have 'char *' and 'int')
    5 |     scanf("%d %d"&N,&M);
      |           ~~~~~~~^
      |           |
      |           char *
Language: C++

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

int main(){
  int N;
  int M;

  cin >> N >> M;

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

  int max_patern = 0;
  max_patern =　((N+M) * (N+M-1)) / 2;

  int patern = 0;
  patern = max_patern - count;
  
  cout << patern << endl;
}

Compiler output:
a.cc:18:15: error: extended character 　 is not valid in an identifier
   18 |   max_patern =　((N+M) * (N+M-1)) / 2;
      |               ^
a.cc: In function 'int main()':
a.cc:18:15: error: '\U00003000' was not declared in this scope
   18 |   max_patern =　((N+M) * (N+M-1)) / 2;
      |               ^~
Language: C++

#include<iostream>
#include<cstdio>
#include <string.h>
using namespace std;

int main() {
    int a, b, c, d, e;
    cin >> a >> b;
    if (a % 2 == 1) {
        a / 2 = c;
        c* b = d;
        if (b == 0) {
            c = d;
        }
        cout << d;

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: lvalue required as left operand of assignment
   10 |         a / 2 = c;
      |         ~~^~~
a.cc:11:10: error: lvalue required as left operand of assignment
   11 |         c* b = d;
      |         ~^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
    int N, M, n, m;
    cin >> N >> M;
    n = (N * (N - 1)) / 2
    m = (M * (M - 1)) / 2
    cout << n + m << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: expected ';' before 'm'
    7 |     n = (N * (N - 1)) / 2
      |                          ^
      |                          ;
    8 |     m = (M * (M - 1)) / 2
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N,M;
  cin >> N >> M;
  
  if(N>=2 && M>=2) {
  cout << combination(N,2)+combination(M,2) << endl;
  }
  else if(N>=2 && M<2){
    cout << combination(N,2) << endl;}
  else if (N<2 && M>=2) {
    cout << combination(M,2) << endl;}
  else if (N<2 && M>=2) {
    cout << 0 << endl;}
  }
     


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'combination' was not declared in this scope
    8 |   cout << combination(N,2)+combination(M,2) << endl;
      |           ^~~~~~~~~~~
a.cc:11:13: error: 'combination' was not declared in this scope
   11 |     cout << combination(N,2) << endl;}
      |             ^~~~~~~~~~~
a.cc:13:13: error: 'combination' was not declared in this scope
   13 |     cout << combination(M,2) << endl;}
      |             ^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
    int ans=0;

    int n , m ;

    cin>>n>>m;

    ans= ((n)(n-1))/2+((m)(m-1))/2;

    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'n' cannot be used as a function
   10 |     ans= ((n)(n-1))/2+((m)(m-1))/2;
      |           ~~~^~~~~
a.cc:10:27: error: 'm' cannot be used as a function
   10 |     ans= ((n)(n-1))/2+((m)(m-1))/2;
      |                        ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll nCr(ll n, ll r) 
{ 
    return fact(n) / (fact(r) * fact(n - r)); 
} 
  
ll fact(ll n) 
{ 
    ll res = 1; 
    for (int i = 2; i <= n; i++) 
        res = res * i; 
    return res; 
} 
int main()
{
	ll n,m;
	cin>>n>>m;
	cout<<nCr(n,2)+nCr(m,2)<<"\n";
}

Compiler output:
a.cc: In function 'll nCr(ll, ll)':
a.cc:6:12: error: 'fact' was not declared in this scope
    6 |     return fact(n) / (fact(r) * fact(n - r));
      |            ^~~~
Language: C++

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

int main(){
  int N;
  int M;
  
  cin >> N >> M;
  
  int count = 0;
  for(int i = 1;i <= N; i++){
    for(int j = 1; j <= M; j++){
      count++;
    }
  }

  int max_patern = 0; 
  max_patern =　((N+M) * (N+M-1)) / 2;

  int patern = 0;
  patern = max_patern - count;
  
  cout << patern << endl;
}

Compiler output:
a.cc:18:15: error: extended character 　 is not valid in an identifier
   18 |   max_patern =　((N+M) * (N+M-1)) / 2;
      |               ^
a.cc: In function 'int main()':
a.cc:18:15: error: '\U00003000' was not declared in this scope
   18 |   max_patern =　((N+M) * (N+M-1)) / 2;
      |               ^~
Language: C++

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

int main(){
 int n,m;
 cin >> n >> m;
 
 if ((n + m) % 2 == 0){
  cout << n * (n - 1) / 2 || m * (m - 1) / 2 << endl;
 }
  else if ((n + m) % 2 == 1){
  cout << 0 << endl;
 }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:46: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |   cout << n * (n - 1) / 2 || m * (m - 1) / 2 << endl;
      |                              ~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  cin >> N >> M;
  
  if (N == 1 && M == 1) {
    cout << 0 << endl;
  }
  else if{
    cout << (N*(N-1))/2+(M*(M-1))/2 << endl;
  }
}

 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected '(' before '{' token
   11 |   else if{
      |          ^
      |          (
Language: C++

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using ll = int64_t;
#define MAX_N 1010
#define MAX_M 100010
const long long mod = pow(10, 9) + 7;
#define vec vector<int>
#define vecll vector<ll>
#define vecllvec vector<vector<ll>>
#define vecb vector<bool>
#define vecBvec vector<vector<bool>>
#define vecst vector<string>
#define veche vector<char>
#define vecd vector<double>
#define vecvec vector<vector<int>>
#define vecDvec vector<vector<double>>
#define vecHvec vector<vector<char>>
#define all(x) (x).begin(),(x).end()
#define ent cout<<endl
#define printvec(vec) for(int aqw=0;aqw<vec.size();aqw++){cout<<vec[aqw]<<" ";}ent;
#define rep1(n) for(ll i = 0; i < (n); ++i)
#define rep2(i, n) for(ll i = 0; i < (n); ++i)
#define rep3(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep4(i, a, b, c) for(ll i = (a); i < (b); i += (c))
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//#define INF 1e+9
#define print(x) cout<<x<<endl;
using P = pair<int, int>;
#define PLL pair<ll, ll>;
#define MAX_V 10010
#define PI 3.141592653589793
#define vecP vector<P>
//cout << setprecision(15) << std::fixed;

std::vector<std::vector<long long>> comb(int n, int r) {
    std::vector<std::vector<long long>> v(n + 1, std::vector<long long>(n + 1, 0));
    for (int i = 0; i < v.size(); i++) {
        v[i][0] = 1;
        v[i][i] = 1;
    }
    for (int j = 1; j < v.size(); j++) {
        for (int k = 1; k < j; k++) {
            v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
        }
    }
    return v;
}

int main() {
    int a, b;
    cin >> a >> b;
    vecllvec v = comb(100, 2);
    print(v[a][2] + v[b][2]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:103:22: error: conversion from 'vector<vector<long long int>>' to non-scalar type 'vector<vector<long int>>' requested
  103 |     vecllvec v = comb(100, 2);
      |                  ~~~~^~~~~~~~
Language: C++

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

int main(){
 int n,m;
 cin >> n >> m;
 
 if ((n + m) % 2 == 0){
  cout << n * (n - 1) / 2 || m * (m - 1) / 2<< endl;
 }
  else if ((n + m) % 2 == 1){
  cout << 0 << endl;
 }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |   cout << n * (n - 1) / 2 || m * (m - 1) / 2<< endl;
      |                              ~~~~~~~~~~~~~~~^~~~~~~
Language: C

#include<stdio.h>
int main (void){
int N=0 ,M=0,s;
scanf("%d %d",&N,&M);
s=N*(N-1)+M*(M-1)
printf("%d",s/2);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:18: error: expected ';' before 'printf'
    5 | s=N*(N-1)+M*(M-1)
      |                  ^
      |                  ;
    6 | printf("%d",s/2);
      | ~~~~~~
Language: C++

    #include <bits/stdc++.h>
    using namespace std;
     
int factorial(int n) { //階乗
  int ans = 1;
  for(int i = 1; i <= n; i++) {
    ans *= i;
  }
  return ans;
}
    int main() {
      int N = 0; //偶数の数
      int M = 0; //奇数の数
      count1 = 0;
      count2 = 0;
      cin >> N >> M;
      
      count1 = factorial(N) / factorial(2) / factorial(N - 2);
      count2 = factorial(M) / factorial(2) / factorial(M - 2);
      
      
      cout << count1 + count2 << endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'count1' was not declared in this scope
   14 |       count1 = 0;
      |       ^~~~~~
a.cc:15:7: error: 'count2' was not declared in this scope
   15 |       count2 = 0;
      |       ^~~~~~
Language: C++

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

int main(){
  int N;
  int M;
  
  cin >> N >> M;
  
  int count = 0;
  for(int i = 1;i <= N; i++){
    for(int j = 1; j <= M; j++){
      count++;
    }
  }
  
  int max_patern = 0; 
  max_patern =　((N+M) * (N+M-1)) / 2;
  
  int patern = 0;
  patern = max_patern - count;
  
  cout << patern << endl;
}

Compiler output:
a.cc:18:15: error: extended character 　 is not valid in an identifier
   18 |   max_patern =　((N+M) * (N+M-1)) / 2;
      |               ^
a.cc: In function 'int main()':
a.cc:18:15: error: '\U00003000' was not declared in this scope
   18 |   max_patern =　((N+M) * (N+M-1)) / 2;
      |               ^~
Language: C++

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

int main(){
  int N;
  int M;
  
  cin >> N >> M;
  
  int count = 0;
  for(int i = 1;i <= N; i++){
    for(int j = 1; j <= M; j++){
      count++;
    }
  }
  
  int max_patern = 0; 
  max_patern =　((N+M) * (N+M-1)) / 2
  
  int patern = 0;
  patern = max_patern - count;
  
  cout << patern << endl;
}

Compiler output:
a.cc:18:15: error: extended character 　 is not valid in an identifier
   18 |   max_patern =　((N+M) * (N+M-1)) / 2
      |               ^
a.cc: In function 'int main()':
a.cc:18:15: error: '\U00003000' was not declared in this scope
   18 |   max_patern =　((N+M) * (N+M-1)) / 2
      |               ^~
a.cc:21:3: error: 'patern' was not declared in this scope; did you mean 'extern'?
   21 |   patern = max_patern - count;
      |   ^~~~~~
      |   extern
Language: C++

#include<iostream>
using namespace std;
int fac(int n)
{
  ans=1;
  for (int i=1; i<=n; i++)
  {
    ans*=i;
  }
}

int c2(int n)
{
  if (n<2){return 0;}
  else
  {
    return fac(n)/(fac(n-2)*2);
  }
}

int main()
{
  int n, m;
  cin>>n>>m;
  cout<<c2(n+m)-m*n;
  return 0;
}
  

Compiler output:
a.cc: In function 'int fac(int)':
a.cc:5:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    5 |   ans=1;
      |   ^~~
      |   abs
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^