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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
                StringBuffer datestr = sc.next();
                datestr.replce(1,4,"2018");
		System.out.println(datestr);
	}
}


Compiler output:
Main.java:5: error: incompatible types: String cannot be converted to StringBuffer
                StringBuffer datestr = sc.next();
                                              ^
Main.java:6: error: cannot find symbol
                datestr.replce(1,4,"2018");
                       ^
  symbol:   method replce(int,int,String)
  location: variable datestr of type StringBuffer
2 errors
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 10000000007; //10^9+7

int dp[2002][2002][2002];
ll n,y;

int main(){
  cin>>n>>y;
  int one=0,five=0,ten=0;
  one=y/1000;
  if(one+five+ten==n){
    print(ten<<" "<<five<<" "<<one);
    return 0;
  }
  if(one<n){
    print("-1 -1 -1");
    return 0;
  }
  int cp=0;
  while(one>4){
    ten=0;
    one-=5;
    five++;
    cp=five;
    if(one+five+ten==n){
      print(ten<<" "<<five<<" "<<one);
      return 0;
    }
    print("a"<<" "<<ten<<" "<<five<<" "<<one);///
    while(cp>1){
      cp-=2;
      ten++;
      if(one+cp+ten==n){
        print(ten<<" "<<cp<<" "<<one);
        return 0;
      }
      print("b"<<" "<<ten<<" "<<cp<<" "<<one);///
    }
  }
  print("-1 -1 -1");
  return 0;
}

Compiler output:
/tmp/ccddt9Ch.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccddt9Ch.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccddt9Ch.o
a.cc:(.text+0x4e): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccddt9Ch.o
a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccddt9Ch.o
a.cc:(.text+0x115): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccddt9Ch.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccddt9Ch.o
a.cc:(.text+0x2c4): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccddt9Ch.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s; cin>>s;
  cout<<"2018";
  rep(i,(int)s.size()-4)cout<<s[i+4];
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   rep(i,(int)s.size()-4)cout<<s[i+4];
      |       ^
a.cc:6:3: error: 'rep' was not declared in this scope
    6 |   rep(i,(int)s.size()-4)cout<<s[i+4];
      |   ^~~
Language: C++

#include<stdio.h>

int main()
{

    char arr[20];
    gets(arr);
    arr[3]='8';
    printf("%s\n", arr);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(arr);
      |     ^~~~
      |     getw
Language: C++

#incude<iosteam>
usingnamespacestd;
intmain()
{
  intdt[31];
  
  for(inti=0;i<31;i++){
    cout<<"2017/01/";
    cin>>dt[i];
  }
  for(intj=0;j<31;j++){
    cout<<"2018/01/""<<dt[j]<<");
  }
  getchar();
return0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude<iosteam>
      |  ^~~~~~
      |  include
a.cc:2:1: error: 'usingnamespacestd' does not name a type
    2 | usingnamespacestd;
      | ^~~~~~~~~~~~~~~~~
a.cc:3:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
    3 | intmain()
      | ^~~~~~~
a.cc: In function 'int intmain()':
a.cc:5:3: error: 'intdt' was not declared in this scope; did you mean 'int'?
    5 |   intdt[31];
      |   ^~~~~
      |   int
a.cc:7:7: error: 'inti' was not declared in this scope; did you mean 'int'?
    7 |   for(inti=0;i<31;i++){
      |       ^~~~
      |       int
a.cc:7:14: error: 'i' was not declared in this scope
    7 |   for(inti=0;i<31;i++){
      |              ^
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout<<"2017/01/";
      |     ^~~~
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin>>dt[i];
      |     ^~~
a.cc:9:10: error: 'dt' was not declared in this scope
    9 |     cin>>dt[i];
      |          ^~
a.cc:11:7: error: 'intj' was not declared in this scope; did you mean 'int'?
   11 |   for(intj=0;j<31;j++){
      |       ^~~~
      |       int
a.cc:11:14: error: 'j' was not declared in this scope
   11 |   for(intj=0;j<31;j++){
      |              ^
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout<<"2018/01/""<<dt[j]<<");
      |     ^~~~
a.cc:14:3: error: 'getchar' was not declared in this scope
   14 |   getchar();
      |   ^~~~~~~
a.cc:1:1: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #incude<iosteam>
a.cc:15:1: error: 'return0' was not declared in this scope
   15 | return0;
      | ^~~~~~~
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
Language: Java

s = gets.chomp
s[0..3] = '2018'
puts s

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
s = gets.chomp
^
Main.java:2: error: unclosed character literal
s[0..3] = '2018'
          ^
Main.java:2: error: illegal line end in character literal
s[0..3] = '2018'
               ^
3 errors
Language: Java

 import java.util.*;
 import java.math.*;
 public class A
 {
 	public static void main (String[] args)
 	{
 		Scanner in = new Scanner(System.in);
 		String str = in.nextLine();

 		System.out.println("2018" + str.substring(4, str.length()));
 		
 	}
 }



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

#include <cstdio>

int main(){
  char s[12];
  scanf("%s", s);
  pritnf("2018");
  for(int i = 4; i < 10; i++){
    printf("%c", s[i]);
  }
  printf("\n");
  return 0;
}

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

#include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <sstream>

using namespace std;

string S;

int main(){
    
    cin >> S;
    
    S(4) = "8";
    
    cout << S << endl;
    
    return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   17 |     S(4) = "8";
      |     ~^~~
Language: C++

use std::io::*;
use std::str::FromStr;

struct Scanner<R: Read> {
    reader: R,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader }
    }

    fn safe_read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            token.parse::<T>().ok()
        }
    }

    fn read<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.safe_read() {
            s
        } else {
            writeln!(stderr(), "Process terminated with EOF").unwrap();
            std::process::exit(0);
        }
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(104_857_600)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
}

fn solve() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);
    loop {
        let s: String = sc.read();
        println!("{}8{}", &s[0..3], &s[4..]);
    }
}


Compiler output:
a.cc:8:2: error: invalid preprocessing directive #[
    8 | #[allow(dead_code)]
      |  ^
a.cc:51:30: error: too many decimal points in number
   51 |         println!("{}8{}", &s[0..3], &s[4..]);
      |                              ^~~~
a.cc:51:40: error: too many decimal points in number
   51 |         println!("{}8{}", &s[0..3], &s[4..]);
      |                                        ^~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::*;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::str::FromStr;
      | ^~~
a.cc:4:8: error: 'Scanner' is not a class template
    4 | struct Scanner<R: Read> {
      |        ^~~~~~~
a.cc:4:16: error: 'R' was not declared in this scope
    4 | struct Scanner<R: Read> {
      |                ^
a.cc:5:5: error: 'reader' does not name a type
    5 |     reader: R,
      |     ^~~~~~
a.cc:9:5: error: expected initializer before '<' token
    9 | impl<R: Read> Scanner<R> {
      |     ^
a.cc:36:1: error: 'fn' does not name a type
   36 | fn main() {
      | ^~
a.cc:45:1: error: 'fn' does not name a type
   45 | fn solve() {
      | ^~
Language: C++

#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<set>
using namespace std;
int main()
  string s[12]="2017/01/";
  cin>>s;
  s[3]='8';
  s[8]=x;
  s[9]=y;
  s[8]<=3;
  s[9]<=9;
  if(s[8]==3) s[9]<=1;
  cout<<s;
  system("pause");
  return 0;
}  

Compiler output:
a.cc:8:3: error: expected initializer before 'string'
    8 |   string s[12]="2017/01/";
      |   ^~~~~~
a.cc:9:3: error: 'cin' does not name a type
    9 |   cin>>s;
      |   ^~~
a.cc:10:3: error: 's' does not name a type
   10 |   s[3]='8';
      |   ^
a.cc:11:3: error: 's' does not name a type
   11 |   s[8]=x;
      |   ^
a.cc:12:3: error: 's' does not name a type
   12 |   s[9]=y;
      |   ^
a.cc:13:3: error: 's' does not name a type
   13 |   s[8]<=3;
      |   ^
a.cc:14:3: error: 's' does not name a type
   14 |   s[9]<=9;
      |   ^
a.cc:15:3: error: expected unqualified-id before 'if'
   15 |   if(s[8]==3) s[9]<=1;
      |   ^~
a.cc:16:3: error: 'cout' does not name a type
   16 |   cout<<s;
      |   ^~~~
a.cc:17:9: error: expected constructor, destructor, or type conversion before '(' token
   17 |   system("pause");
      |         ^
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C

#include<stdio.h>
int main(){
   int  I;
   char s[10];
   for(i=0;i<10;i++){
       scanf("%s",s[i]);
   }
 
   s[3]=8;
 
    for(i=0;i<10;i++){
    printf("%s\n",s[i]);
   }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:8: error: 'i' undeclared (first use in this function)
    5 |    for(i=0;i<10;i++){
      |        ^
main.c:5:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:1: error: stray '\302' in program
    8 | <U+00A0>
      | ^~~~~~~~
main.c:10:1: error: stray '\302' in program
   10 | <U+00A0>
      | ^~~~~~~~
Language: C

#include<stdio.h>
int main(){
   char s[10];
   for(int i=0;i<10;i++){
       scanf("%s",s[i]);
   }

   s[3]=8;

    for(i=0;i<10;i++){
    printf(%s,s[i]);
   }
   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'i' undeclared (first use in this function)
   10 |     for(i=0;i<10;i++){
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:12: error: expected expression before '%' token
   11 |     printf(%s,s[i]);
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
	char y[15];
    cin>>y;
    s[3]='8';
    cout<<y<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 's' was not declared in this scope
   10 |     s[3]='8';
      |     ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
	char y[15];
    cin>>y;
    s[3]='8'
    cout<<y<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 's' was not declared in this scope
   10 |     s[3]='8'
      |     ^
Language: C++

#include <iostream>
using namespace std;
  
int main()
{
  char date[20];
  cin>>date;
  date[3] = 8;
  cout<<date<<endl;
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected ';' before '}' token
   10 |   return 0
      |           ^
      |           ;
   11 | }
      | ~
Language: C++

#include <iostream>
using namespace std 
  
int main()
{
  char date[20];
  cin>>date;
  date[3] = 8;
  cout<<date<<endl;
  return 0
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main()
      | ~~~                 
a.cc: In function 'int main()':
a.cc:10:11: error: expected ';' before '}' token
   10 |   return 0
      |           ^
      |           ;
   11 | }
      | ~
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
      String date = args[0];
      // 出力
      System.out.println(”2018” + date.substring(4));                
  }
}

Compiler output:
Main.java:6: error: illegal character: '\u201d'
      System.out.println(?2018? + date.substring(4));                
                         ^
Main.java:6: error: illegal character: '\u201d'
      System.out.println(?2018? + date.substring(4));                
                              ^
Main.java:6: error: ';' expected
      System.out.println(?2018? + date.substring(4));                
                                                   ^
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
        String date = args[0];
    	// 出力
    	System.out.println(“2018” + date.substring(4));                
    }
}

Compiler output:
Main.java:6: error: illegal character: '\u201c'
    	System.out.println(?2018? + date.substring(4));                
    	                   ^
Main.java:6: error: illegal character: '\u201d'
    	System.out.println(?2018? + date.substring(4));                
    	                        ^
Main.java:6: error: ';' expected
    	System.out.println(?2018? + date.substring(4));                
    	                                             ^
3 errors
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
      String date = args[0];
      // 出力
      System.out.println(“2018” + date.substring(4));                
  }
}

Compiler output:
Main.java:6: error: illegal character: '\u201c'
      System.out.println(?2018? + date.substring(4));                
                         ^
Main.java:6: error: illegal character: '\u201d'
      System.out.println(?2018? + date.substring(4));                
                              ^
Main.java:6: error: ';' expected
      System.out.println(?2018? + date.substring(4));                
                                                   ^
3 errors
Language: C++

#include<stdio.h>
int main()
{
	char s[11];
	gets(s);
	s[0]='2';
	s[1]='0';
	s[2]='1';
	s[3]='8';
	puts(s);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <string>
#include <cstring>

using namespace std;

#define N_MAX 128
bool bin[N_MAX];

int main(void){
	memset(bin,0,sizeof(bin));

	cin >> N;
	for (int i=0; i<N; i++){
		int tmp;
		cin >> tmp;
		bin[tmp] = true;
	}

	int ans=0;
	for (int i=0; i<N_MAX; i++){
		if (bin[i]) ans++;
	}

	cout << ans << "\n";
	
	return 0;
}

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

{
      int y,m,d;
     scanf("%d/%d/%d",&y,&m,&d);
     printf("%d/",y+1);
     printf("0%d/",m);
     if(d>9)
        printf("%d",d);
     else
        printf("0%d",d);
     return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before '{' token
    1 | {
      | ^
Language: C++

#include "stdafx.h"
#include <stdio.h>
#include <tchar.h>
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string s;
	cin >> s;
	s[3] = '8';
	cout << s;
    return 0;
}

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

#include <stdio.h>
#include <tchar.h>
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string s;
	cin >> s;
	s[3] = '8';
	cout << s;
    return 0;
}



Compiler output:
a.cc:2:10: fatal error: tchar.h: No such file or directory
    2 | #include <tchar.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
char S;
int main (){
scanf("%s",&S);
S[3]=8;
printf("%s",S);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: invalid types 'char[int]' for array subscript
    5 | S[3]=8;
      |  ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
char s[];
cin>>s;
cout<<"2018/1/"<<s[8]<<s[9]<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() 
{
	char a[10];
	getchar();
	getchar();
	getchar();
	getchar();
	gets(a);
	printf("2018");
	puts(a);
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(void){
 string s;
 cin >> s;
 s[0] = '2';
 s[1] = '0';
 s[2] = '1';
 s[3] = '8';
count << s << "\n";

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'count' was not declared in this scope
   11 | count << s << "\n";
      | ^~~~~
Language: C++


#include "stdafx.h"
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string date;
	cin >> date;
	date[3] = '8';
	cout << date << endl;

    return 0;
}


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

#include<stdio.h>
int main()
{
      int d;
     scanf("%d/%d/%d",2017,1,&d);
     printf("%d/%d/%d,2017+1,1,d);
     return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: warning: missing terminating " character
    6 |      printf("%d/%d/%d,2017+1,1,d);
      |             ^
main.c:6:13: error: missing terminating " character
    6 |      printf("%d/%d/%d,2017+1,1,d);
      |             ^~~~~~~~~~~~~~~~~~~~~~
main.c:7:6: error: expected expression before 'return'
    7 |      return 0;
      |      ^~~~~~
main.c:7:15: error: expected ';' before '}' token
    7 |      return 0;
      |               ^
      |               ;
    8 | }
      | ~
Language: C

#include<stdio.h>
int main()
{
      int d;
      scanf("2017/1/%d",&d);
     printf("%d/%d/%d,2017+1,1,d);
     return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: warning: missing terminating " character
    6 |      printf("%d/%d/%d,2017+1,1,d);
      |             ^
main.c:6:13: error: missing terminating " character
    6 |      printf("%d/%d/%d,2017+1,1,d);
      |             ^~~~~~~~~~~~~~~~~~~~~~
main.c:7:6: error: expected expression before 'return'
    7 |      return 0;
      |      ^~~~~~
main.c:7:15: error: expected ';' before '}' token
    7 |      return 0;
      |               ^
      |               ;
    8 | }
      | ~
Language: C++

#include<iostream>
#include<cstdlib>
#include<stdio.h>
using namespace std;

int main()
{
	char A[20];
	int i;
	gets(A);
	for (i=0;i<10;i++)
	  {
	  	if (i==3) printf("8");
	  	   else printf("%c",A[i]);
	  }
	return 0;  
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets(A);
      |         ^~~~
      |         getw
Language: C++

#include<iostream>
using namespace std;
int main(){
  string s;
  cin>>s;
  for(int i=0;i<s.length;i++){
    if(i==3)cout<<s[i]+1;
    else cout<<s[i];
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    6 |   for(int i=0;i<s.length;i++){
      |                 ~~^~~~~~
      |                         ()
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define vec vector<int>
#define pb push_back



int main(){
	int a,b,c,d,e,f,g;
	char o,p,q,r,s,t,u;
	char ans;

	scanf("%d",&o);

	std::vector<char> O;

	std::vector<char> O[3] ="8";

	ans = std::vector<char> O;


	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: error: conflicting declaration 'std::vector<char> O [3]'
   27 |         std::vector<char> O[3] ="8";
      |                           ^
a.cc:25:27: note: previous declaration as 'std::vector<char> O'
   25 |         std::vector<char> O;
      |                           ^
a.cc:29:33: error: expected primary-expression before 'O'
   29 |         ans = std::vector<char> O;
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() 
{
	char a[9];
	gets(a);
	a[3]='8';
	puts(a);
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define vec vector<int>
#define pb push_back



int main(){
	int a,b,c,d,e,f,g;
	char o,p,q,r,s,t,u;
	char ans;

	scanf("%d",&o);

	vector<char> O;

	vector<char> O[3] ="8";

	ans = vector<char> O;


	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: conflicting declaration 'std::vector<char> O [3]'
   27 |         vector<char> O[3] ="8";
      |                      ^
a.cc:25:22: note: previous declaration as 'std::vector<char> O'
   25 |         vector<char> O;
      |                      ^
a.cc:29:28: error: expected primary-expression before 'O'
   29 |         ans = vector<char> O;
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
   for (int i=0;i<10;i++)
{
cahr a;
cin>>a;
if (i==3)
{
cout<<'8';
}
else
{
cout<<a;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cahr' was not declared in this scope; did you mean 'char'?
    7 | cahr a;
      | ^~~~
      | char
a.cc:8:6: error: 'a' was not declared in this scope
    8 | cin>>a;
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() 
{
	char a[10];
	gets(a);
	a[3]='8';
	puts(a);
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define vec vector<int>
#define pb push_back



int main(){
	int a,b,c,d,e,f,g;
	char o,p,q,r,s,t,u;
	char ans;

	scanf("%d",&o);

	vector<char> o;

	vector<char> o[3] ="8";

	ans = vector<char> o;


	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: conflicting declaration 'std::vector<char> o'
   25 |         vector<char> o;
      |                      ^
a.cc:20:14: note: previous declaration as 'char o'
   20 |         char o,p,q,r,s,t,u;
      |              ^
a.cc:27:22: error: conflicting declaration 'std::vector<char> o [3]'
   27 |         vector<char> o[3] ="8";
      |                      ^
a.cc:20:14: note: previous declaration as 'char o'
   20 |         char o,p,q,r,s,t,u;
      |              ^
a.cc:29:28: error: expected primary-expression before 'o'
   29 |         ans = vector<char> o;
      |                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  	string s;
  	cin>>s;
  	s.replace(s.begin(),s.begin+4,"2018");
  	cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:36: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
    7 |         s.replace(s.begin(),s.begin+4,"2018");
      |                             ~~~~~~~^~
      |                               |     |
      |                               |     int
      |                               <unresolved overloaded function type>
Language: C++

import java.util.*;
import java.io.*;
class Main {
    public static void main(String args[]) throws IOException {
        System.out.println(new Scanner(System.in).next().replaceFirst("2017", "2018"));
        
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String args[]) throws IOException {
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String args[]) throws IOException {
      |                             ^~~~~~
a.cc:4:42: error: expected ';' at end of member declaration
    4 |     public static void main(String args[]) throws IOException {
      |                                          ^
      |                                           ;
a.cc:4:44: error: 'throws' does not name a type
    4 |     public static void main(String args[]) throws IOException {
      |                                            ^~~~~~
a.cc:8:2: error: expected ';' after class definition
    8 | }
      |  ^
      |  ;
Language: C++

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
char s[10001];
int main(){
	scanf("%*d");
	gets(s);
	printf("2018%s",s);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets(s);
      |         ^~~~
      |         getw
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

public class main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		String s = in.next();
		System.out.println("2018"+ s.substring(4));
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  s[3]='8'
  cout<<s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected ';' before 'cout'
    7 |   s[3]='8'
      |           ^
      |           ;
    8 |   cout<<s;
      |   ~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
  string s;cin>>s;
  cout<<2018;
  REP(i,s.length()-4){
    cout<<s[i+4];
  }
  cout<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   REP(i,s.length()-4){
      |       ^
a.cc:9:3: error: 'REP' was not declared in this scope
    9 |   REP(i,s.length()-4){
      |   ^~~
Language: C++

#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

std::string S;

int main()
{
	in>>S;
	S[0]=2,S[1]=0,S[2]=1,S[3]=8;
	out<<S<<std::endl;A
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: 'A' was not declared in this scope
   13 |         out<<S<<std::endl;A
      |                           ^
Language: C++

#include"bits/stdc++.h"

using namespace std;

int main() {
	string a;
	cin >> a;
	a[3] = '8';
	cout << s << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 's' was not declared in this scope
    9 |         cout << s << endl;
      |                 ^
Language: C++

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

int main() {
  int N. num, count;
  cin >> N;
  
  vector<int> vec(N);
  
  for (int i=0; i<N+ i++) {
    cin >> vec.at(i);
  }
  
  sort(vec.begin(), vec.end()); //sort
  reverse(vec.begin(), vec.end());

  num = 0;
  count = 1;
  for (int i=0; i<N+ i++) {
    if (num == vec.at(i) {
      count++;
    }
    num = vec.at(i); // num に大きい方からvecを代入
  }
  cout << num << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    5 |   int N. num, count;
      |        ^
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N;
      |          ^
a.cc:10:25: error: expected ';' before ')' token
   10 |   for (int i=0; i<N+ i++) {
      |                         ^
      |                         ;
a.cc:17:3: error: 'num' was not declared in this scope; did you mean 'enum'?
   17 |   num = 0;
      |   ^~~
      |   enum
a.cc:18:11: error: overloaded function with no contextual type information
   18 |   count = 1;
      |           ^
a.cc:19:25: error: expected ';' before ')' token
   19 |   for (int i=0; i<N+ i++) {
      |                         ^
      |                         ;
a.cc:23:20: error: expected ')' before ';' token
   23 |     num = vec.at(i); // num に大きい方からvecを代入
      |                    ^
      |                    )
a.cc:20:8: note: to match this '('
   20 |     if (num == vec.at(i) {
      |        ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  set<int> st;
  
  rep(i,n){
    int d;
    cin >> d;
    st.insert(d)
  }
  
  cout << st.size() << endl;
  
}
  
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ';' before '}' token
   14 |     st.insert(d)
      |                 ^
      |                 ;
   15 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long a=0;
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    //cout.setf(ios_base::fixed,ios_base::floatfield);
    int n,m,z=0;
    cin>>n;
    bool a[101]={false};
    for(int i=0;i<n;i++){
        cin>>m;
        a[m]=true;
    }
    for(int i=0;i<101;i++){
        if(a[i]==true) z++;
    }
    cout<<z<<'\n';
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
long long a=0;
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    //cout.setf(ios_base::fixed,ios_base::floatfield);
    int n,m,z=0;
    cin>>n;
    bool a[101]={false};
    for(int i=0;i<n;i++){
        cin>>m;
        a[m]=true;
    }
    for(int i=0;i<101;i++){
        if(a[i]==true) z++;
    }
    cout<<z<<'\n';
    return 0;
}

Compiler output:
a.cc:23:11: error: redefinition of 'long long int a'
   23 | long long a=0;
      |           ^
a.cc:3:11: note: 'long long int a' previously defined here
    3 | long long a=0;
      |           ^
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int>mochi(N);

  for(int i = 0; i < N; i++){
    int d_i;
    cin >> d_i;

    mochi.at(i) = d_i;
  }

  for(int j = 0; j < N; j++){
    for(int k = j + 1; k < N; k++){
      if(mochi.at(j) == mochi.at(k)){
        mochi.at(k) = 0;
      }

    }
  }

  int sum = 0;
  for(int l = 0; l < N; l++){
    if(mochi.at(l) != 0){
      sum++;
    }
  }

  cout << sum << emdl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: 'emdl' was not declared in this scope
   32 |   cout << sum << emdl;
      |                  ^~~~
Language: C++

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

int x,a[10000],b[10000],sum=0;
int main(){
    cin>>x;
    for(int i=1;i<=x;i++){
        cin>>a[i];
        c[a[i]]++;
    }
    for(int i=1;i<=10000;i++){
        if (c[i]>=1){
            c[i]=1;
        }
        else{
            c[i]=0;
        }
    }
    for(int i=1;i<=10000;i++){
        sum+=c[i];
    }
    cout<<x-sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'c' was not declared in this scope
    9 |         c[a[i]]++;
      |         ^
a.cc:12:13: error: 'c' was not declared in this scope
   12 |         if (c[i]>=1){
      |             ^
a.cc:20:14: error: 'c' was not declared in this scope
   20 |         sum+=c[i];
      |              ^
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        for(int i = 0 ; i < n ; i ++){
          list.add(sc.nextInt());
        }
		 List<Integer> listB = new ArrayList<Integer>(new HashSet<>(list));
      
      	 System.out.print(listB.length());

    }
}






Compiler output:
Main.java:13: error: cannot find symbol
      	 System.out.print(listB.length());
      	                       ^
  symbol:   method length()
  location: variable listB of type List<Integer>
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();  
      
      List<Integer> split = new ArrayList<>();
        for (int i = 0; i < n; i++) {
	        int buf = sc.nextInt();
	        list.add(buf);
        }
        
        int tmp = 0;
        int tmp2 = 0;
        int size = split.size();

        for(int i = 0; i < size ; i++ ){
            tmp = split.get(i);
            
            for(int j = 0; j < size ; j++){
                tmp2 = split.get(j);
                
                if(tmp2 == tmp && j!= i){
                  split.remove(j);
                  size -= 1;
                }
            }
        }
    System.out.println(size);
  }
}

Compiler output:
Main.java:11: error: cannot find symbol
	        list.add(buf);
	        ^
  symbol:   variable list
  location: class Main
1 error
Language: C++

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


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  int count = 0;
  
  for (int i = 0; i < N; i++) cin >> a.at(i)
  sort(a, a + N, greater<int>());
  for (int i = 0; i < N - 1; i++) { 
    if (a.at(i) !== a.at(i + 1)) count++;
  }
  
  cout << count << endl;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:45: error: expected ';' before 'sort'
   10 |   for (int i = 0; i < N; i++) cin >> a.at(i)
      |                                             ^
      |                                             ;
   11 |   sort(a, a + N, greater<int>());
      |   ~~~~                                       
a.cc:13:19: error: expected primary-expression before '=' token
   13 |     if (a.at(i) !== a.at(i + 1)) count++;
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,i,counter;
  counter=1;
  cin >> n;
  vector<int>vec(n);
  for(i=0;i<n;i++){
    cin >> vec.at(i);  
}  
  sort(vec.begin(),vec.end());
  ma=vec.at(0);
  for(i=0;i<n;i++){
    if(max(vec.at(i),ma)=vec.at(i))
      counter++;
      ma=vec.at(i)
    else
      continue;
  }
  cout << counter << endl;
} 


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,i,counter;
  cin >> n;
  vector<int>vec(n);
  for(i=0;i<n;i++){
    cin >> vec.at(i);  
}  
  sort(vec.bigin(),vec.end());
  for(i=1;i<n;i++){
    if(vec.at(i)>vec.at(i-1))
      counter++;
    else
      continue;
  }
  cout << counter << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   10 |   sort(vec.bigin(),vec.end());
      |            ^~~~~
      |            begin
Language: C++

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

int main() {
    int n;
    vector<int> d[n];
    for (int x : d) cin >> x;

    sort(d.begin(), d.end());
    int ans = n;
    for (int i = 1; i < n; i++) {
        if (d[i] == d[i-1]) {
            n--;
        }
    } 

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: cannot convert 'std::vector<int>' to 'int' in initialization
    7 |     for (int x : d) cin >> x;
      |                  ^
a.cc:9:12: error: request for member 'begin' in 'd', which is of non-class type 'std::vector<int> [n]'
    9 |     sort(d.begin(), d.end());
      |            ^~~~~
a.cc:9:23: error: request for member 'end' in 'd', which is of non-class type 'std::vector<int> [n]'
    9 |     sort(d.begin(), d.end());
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  vector<int> changed(N);
  for (int i = 0; i < N; i++) {
    int S = 0, k = 0;
    for (int j = 0; j < N; j++) {
      if (vec.at(j) > S) {
        S = vec.at(j);
        k = j;
      }
    }
    changed.at(i) = S;
    vec.at(k) = 0;
  }
  int A = 0;
  for (int i = 0; i < N - 1; i++) {
    if (changed.at(i) > changed.at(i + 1)) {A++}
  }
  cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:48: error: expected ';' before '}' token
   25 |     if (changed.at(i) > changed.at(i + 1)) {A++}
      |                                                ^
      |                                                ;
Language: C++

int main() {
	int N;
	cin >> N;
	vector<int> vec(N);
	for(int i=0;i<N;i++){
		cin >> vec.at(i); 
	}
	sort(vec.begin(), vec.end(), greater<int>());
	vec.erase(unique(vec.begin(), vec.end()),vec.end());

	cout << vec.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:4:9: error: 'vector' was not declared in this scope
    4 |         vector<int> vec(N);
      |         ^~~~~~
a.cc:4:16: error: expected primary-expression before 'int'
    4 |         vector<int> vec(N);
      |                ^~~
a.cc:6:24: error: 'vec' was not declared in this scope
    6 |                 cin >> vec.at(i);
      |                        ^~~
a.cc:8:14: error: 'vec' was not declared in this scope
    8 |         sort(vec.begin(), vec.end(), greater<int>());
      |              ^~~
a.cc:8:38: error: 'greater' was not declared in this scope
    8 |         sort(vec.begin(), vec.end(), greater<int>());
      |                                      ^~~~~~~
a.cc:8:46: error: expected primary-expression before 'int'
    8 |         sort(vec.begin(), vec.end(), greater<int>());
      |                                              ^~~
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(vec.begin(), vec.end(), greater<int>());
      |         ^~~~
      |         short
a.cc:9:19: error: 'unique' was not declared in this scope
    9 |         vec.erase(unique(vec.begin(), vec.end()),vec.end());
      |                   ^~~~~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << vec.size() << endl;
      |         ^~~~
a.cc:11:31: error: 'endl' was not declared in this scope
   11 |         cout << vec.size() << endl;
      |                               ^~~~
Language: C++

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

int N, A, brosky[105], michael=0;

int main () {
  cin >> N;
  for (int i=1;i<=N;i++){
    cin >> A;
    brosky[A]++;
  }
  //baca frekuensi sampai 100, karena bilangan dapat berupa puluhan dan seratus
  for(int num=1; num<=100; i++) {
    if(brosky[num]>0){
      michael++;
    }
  }
  cout << michael << endl;
} 


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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  vector<int>vec(N);
  cin>>N;
  for(int i=0;i<N;i++)
  {sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());}
    int temp=0,ans=0;
    for(i=0;i<N;i++){
      if (temp==vec.at(i))continue;
      temp=vec.at(i);
      ans++}
  }
      
   cout<<ans<<endl; 

  }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |     for(i=0;i<N;i++){
      |         ^
a.cc:15:12: error: expected ';' before '}' token
   15 |       ans++}
      |            ^
      |            ;
a.cc: At global scope:
a.cc:18:4: error: 'cout' does not name a type
   18 |    cout<<ans<<endl;
      |    ^~~~
a.cc:20:3: error: expected declaration before '}' token
   20 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  vector<int>vec(N);
  cin>>N;
  for(int i=0;i<N;i++)
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    int temp=0,ans=0;
    for(i=0;i<N;i++){
      if (temp==vec.at(i)){continue;
      temp=vec.at(i);
      ans++}
  }
      
   cout<<ans<<endl; 

  }
    


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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  vector<int>vec(N);
  cin>>N;
  for(int i=0;i<N;i++)
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    int temp=0,ans=0;
    for(i=0;i<N;i++){
      if (temp==vec.at(i))continue;
      temp=vec.at(i);
      ans++}
  }
      
   cout<<ans<<endl; 

  }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |     for(i=0;i<N;i++){
      |         ^
a.cc:15:12: error: expected ';' before '}' token
   15 |       ans++}
      |            ^
      |            ;
a.cc: At global scope:
a.cc:18:4: error: 'cout' does not name a type
   18 |    cout<<ans<<endl;
      |    ^~~~
a.cc:20:3: error: expected declaration before '}' token
   20 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  vector<int>vec(N);
  cin>>N;
  for(int i=0;i<N;i++)
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    int temp=0,ans=0;
    for(i=0;i<N;i++){
     ( if temp==vec.at(i))continue;
      temp=vec.at(i);
      ans++}
  }
      
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |     for(i=0;i<N;i++){
      |         ^
a.cc:13:8: error: expected primary-expression before 'if'
   13 |      ( if temp==vec.at(i))continue;
      |        ^~
a.cc:13:7: error: expected ')' before 'if'
   13 |      ( if temp==vec.at(i))continue;
      |      ~^~~
      |       )
a.cc:15:12: error: expected ';' before '}' token
   15 |       ans++}
      |            ^
      |            ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  vector<int>vec(N);
  cin>>N;
  for(int i=0;i<N;i++){
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    int temp=0,ans=0;
    for(i=0;i<N;i++){
     ( if temp==vec.at(i))continue;
      temp=vec.at(i);
      ans++}
  }
      
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: expected primary-expression before 'if'
   13 |      ( if temp==vec.at(i))continue;
      |        ^~
a.cc:13:7: error: expected ')' before 'if'
   13 |      ( if temp==vec.at(i))continue;
      |      ~^~~
      |       )
a.cc:15:12: error: expected ';' before '}' token
   15 |       ans++}
      |            ^
      |            ;
a.cc:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  vector<int>vec(N);
  cin>>N;
  for(int i=0;i<N;i++){
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    int temp=0;ans=0;
    for(i=0;i<N;i++){
     ( if temp==vec.at(i))continue;
      temp=vec.at(i);
      ans++}
  }
      
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     int temp=0;ans=0;
      |                ^~~
      |                abs
a.cc:13:8: error: expected primary-expression before 'if'
   13 |      ( if temp==vec.at(i))continue;
      |        ^~
a.cc:13:7: error: expected ')' before 'if'
   13 |      ( if temp==vec.at(i))continue;
      |      ~^~~
      |       )
a.cc:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  int N=0;
  cin >> N;
  vector<int> = d(N);
  for(int i=0;i<N;i++){
   cin >> d.at(i); 
  }
  
  sort(d.begin(),d.end());
  reverse(d.begin(),d.end());
  
  int count=1;
  
  for(int i=0;i<N-1;i++){
    if(d.at(i)>d.at(i+1)){
     count+=1; 
    }
  }
  
  cout << count << endl;
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected unqualified-id before '=' token
    7 |   vector<int> = d(N);
      |               ^
a.cc:9:11: error: 'd' was not declared in this scope
    9 |    cin >> d.at(i);
      |           ^
a.cc:12:8: error: 'd' was not declared in this scope
   12 |   sort(d.begin(),d.end());
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int x,n,a,b;
  cin >> n;
  vector<int> vecx(0);
  for (int j = 0; j < n; j++) {
   cin >> x;
   vecx.push_back(x);
  }
  sort(vecx.begin(), vecx.end());
  for (int j = 0; j < n-1; j++) {
    a = vecx.at(j);
    b = vecx.at(j+1);
    if (a == b) {
      counter++;
    }
  }
  cout << counter << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'counter' was not declared in this scope
   16 |       counter++;
      |       ^~~~~~~
a.cc:19:11: error: 'counter' was not declared in this scope
   19 |   cout << counter << endl;
      |           ^~~~~~~