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

# include <iostream>
using namespace std ;
int main () {
// input
int N; cin >> N ;
vector <int > H ( N );
for ( int i = 0; i < N ; ++ i ) {
cin >> H [ i ];
}
// compute
int ans = 0;
for ( int i = 0; i < N ; ++ i ) {
bool is_candidate = true ;
for ( int j = 0; j < i ; ++ j ) {
if ( H [ j ] > H [ i ]) {
is_candidate = false ;
break ;
}
}
if ( is_candidate ) {
++ ans ;
}
}
// output
cout << ans << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'vector' was not declared in this scope
    6 | vector <int > H ( N );
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | # include <iostream>
  +++ |+#include <vector>
    2 | using namespace std ;
a.cc:6:9: error: expected primary-expression before 'int'
    6 | vector <int > H ( N );
      |         ^~~
a.cc:8:8: error: 'H' was not declared in this scope
    8 | cin >> H [ i ];
      |        ^
a.cc:15:6: error: 'H' was not declared in this scope
   15 | if ( H [ j ] > H [ i ]) {
      |      ^
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  vector <int> H(N); 
  for(int num=0; num<N; ++num){
    cin >> H[num];
      }
  
  int k=0;
  
  for(int num=0; num<N; ++num){
    bool s = true;
      for (int t = 0; num<t; ++t){
        if (H[t]<H[s]){
          s = false;
          break;
          }}
        if (s){
          ++k;}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector <int> H(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:11: error: expected primary-expression before 'int'
    8 |   vector <int> H(N);
      |           ^~~
a.cc:10:12: error: 'H' was not declared in this scope
   10 |     cin >> H[num];
      |            ^
a.cc:18:13: error: 'H' was not declared in this scope
   18 |         if (H[t]<H[s]){
      |             ^
Language: C++

#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
using namespace std;

int main(){
  int n;  cin >> s;
  int h[n]; int ans=0;
  for(int i=0;i<n;i++) cin >> h[i];
  
  for(int p=0;p<n;p++){
    bool pop = true;
    for(int i=0;i<p;i++){
      if(h[p] < h[j]){
        pop = false;
        break;
      }
    }
    if(bool){
      ans++;
    }
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: 's' was not declared in this scope
   11 |   int n;  cin >> s;
      |                  ^
a.cc:18:19: error: 'j' was not declared in this scope
   18 |       if(h[p] < h[j]){
      |                   ^
a.cc:23:12: error: expected unqualified-id before ')' token
   23 |     if(bool){
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  vector <int> H[N]; 
  for(int num=0; num<N; ++num){
    cin >> H[num];
      }
  
  int k=0;
  
  for(int num=0; num<N; ++num){
    bool s = true;
      for (int t = 0; num<t; ++t){
        if (H[t]<H[s]){
          s = false;
          break;
          }}
        if (s){
          ++k;}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector <int> H[N];
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:11: error: expected primary-expression before 'int'
    8 |   vector <int> H[N];
      |           ^~~
a.cc:10:12: error: 'H' was not declared in this scope
   10 |     cin >> H[num];
      |            ^
a.cc:18:13: error: 'H' was not declared in this scope
   18 |         if (H[t]<H[s]){
      |             ^
Language: Java

ソースコード 拡げる

Copy
Copy
import java.util.Scanner;
 
class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String n = scanner.nextLine();
    String[] h = scanner.nextLine().split(" ");
    
    int max = Integer.parseInt(h[0]);
    int lookAble = 1;
    
    for(int = i; i < h.length; i++) {
      if(max < Integer.parseInt(h[i])) {
        lookAble += 1;
        max = Integer.parseInt(h[i]);
      }
    }
 
    System.out.print(lookAble);
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
?????? ???
^
Main.java:16: error: not a statement
    for(int = i; i < h.length; i++) {
        ^
Main.java:16: error: ';' expected
    for(int = i; i < h.length; i++) {
           ^
Main.java:16: error: illegal start of expression
    for(int = i; i < h.length; i++) {
            ^
Main.java:16: error: not a statement
    for(int = i; i < h.length; i++) {
                   ^
Main.java:16: error: ')' expected
    for(int = i; i < h.length; i++) {
                             ^
Main.java:16: error: ';' expected
    for(int = i; i < h.length; i++) {
                                  ^
7 errors
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; ++i){
    cin >> H[i];
      }
  
  int k=0;
  
  for(int num=0; num<N; ++num){
    bool s = true;
      for (int t = 0; num<t; ++t){
        if (H[t]<H[s]){
          s = false;
          break;
          }}
        if (s){
          ++k;}
    
  cout << k <<endl;
  
  return 0;
  }
    

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

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; ++i){
    cin >> H[i];
      }
  
  int k=0;
  
  for(int num=0; num<N; ++s){
    bool s = true;
      for (int t = 0; num<t; ++t){
        if (H[t]<H[s]){
          s = false;
          break;
          }}
        if (s){
          ++k;}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: 's' was not declared in this scope
   17 |   for(int num=0; num<N; ++s){
      |                           ^
a.cc:30:4: error: expected '}' at end of input
   30 |   }
      |    ^
a.cc:5:3: note: to match this '{'
    5 |   {
      |   ^
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  
  int k=0;
  
  for(int num=0; num<N; s++){
    bool s = true;
      for (int t = 0; num<t; t++){
        if (H[t]<H[s]){
          s = false;
          break;
          }}
        if (s){
          k++;}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 's' was not declared in this scope
   17 |   for(int num=0; num<N; s++){
      |                         ^
a.cc:30:4: error: expected '}' at end of input
   30 |   }
      |    ^
a.cc:5:3: note: to match this '{'
    5 |   {
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace stsd;
int main(){
	int n;
  cin>>n;
  int arr[n];
  for(int i =0; i < n; i++){
  	cin>>arr[i];
  }
  int co = 1;
  for(int i =0; i+1 < n; i++){
  	if(arr[i] >= arr[i+1]){
    	break;	
    }
    co++;
  }
  cout<<co<<"\n";
}

Compiler output:
a.cc:2:17: error: 'stsd' is not a namespace-name
    2 | using namespace stsd;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<<co<<"\n";
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:17:14: error: 's' undeclared (first use in this function)
   17 |     if(h[i]>=s){
      |              ^
main.c:17:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:17:14: error: 's' undeclared (first use in this function)
   17 |     if(h[i]>=s){
      |              ^
main.c:17:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
  int n,i,j;
  int h[100];
  int sum=1;
  int max;
  scanf("%d\n",&n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  max=h[0];
  for(i=1;i<n;i++){
    for(j=0;j<i;j++){
    if(max<h[ij){
      max=h[j];
    }
    if(h[i>=s){
      sum=sum+1;
    }
  }
  }
  printf("%d",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:14: error: 'ij' undeclared (first use in this function); did you mean 'j'?
   14 |     if(max<h[ij){
      |              ^~
      |              j
main.c:14:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:16: error: expected ']' before ')' token
   14 |     if(max<h[ij){
      |                ^
      |                ]
main.c:17:13: error: 's' undeclared (first use in this function)
   17 |     if(h[i>=s){
      |             ^
main.c:17:14: error: expected ']' before ')' token
   17 |     if(h[i>=s){
      |              ^
      |              ]
Language: C++

#include<bits/stdc++.h>
using namespace stsd;
int main(){
	int n;
  cin>>n;
  int arr[n];
  for(int i =0; i < n; i++){
  	cin>>arr[i];
  }
  int co = 1;
  for(int i =0; i+1 < n; i++){
  	if(arr[i] > arr[i+1]){
    	break;	
    }
    co++;
  }
  cout<<co<<"\n";
}

Compiler output:
a.cc:2:17: error: 'stsd' is not a namespace-name
    2 | using namespace stsd;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<<co<<"\n";
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  
  int k=1;
  int t=0;
  
  for(int s=1; s<num; s++){
    do{
      t++;
      }while(t<s && H[t]<=H[s]);
      if (t=s){
        k+=1;
        }}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc:26:3: error: 'cout' does not name a type
   26 |   cout << k <<endl;
      |   ^~~~
a.cc:28:3: error: expected unqualified-id before 'return'
   28 |   return 0;
      |   ^~~~~~
a.cc:29:3: error: expected declaration before '}' token
   29 |   }
      |   ^
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  
  int k=1;
  int t=0;
  
  for(int s=1; s<num; s++){
    do{
      t++;
      }while(t<s && H[t]<=H[s])
      if (t=s){
        k+=1;
        }}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: expected ';' before 'if'
   21 |       }while(t<s && H[t]<=H[s])
      |                                ^
      |                                ;
   22 |       if (t=s){
      |       ~~                        
a.cc: At global scope:
a.cc:26:3: error: 'cout' does not name a type
   26 |   cout << k <<endl;
      |   ^~~~
a.cc:28:3: error: expected unqualified-id before 'return'
   28 |   return 0;
      |   ^~~~~~
a.cc:29:3: error: expected declaration before '}' token
   29 |   }
      |   ^
Language: C

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


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

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  
  int k=1;
  
  for(int s=1; s<num; s++){
    while(int t=0; t<s && H[t]<=H[s]; t++){
      if (t=s){
        k+=1;
        }}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ')' before ';' token
   18 |     while(int t=0; t<s && H[t]<=H[s]; t++){
      |          ~       ^
      |                  )
a.cc:18:20: error: 't' was not declared in this scope
   18 |     while(int t=0; t<s && H[t]<=H[s]; t++){
      |                    ^
Language: Java

public class Main {
	public static void ain(String[] args) {

		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int lookAble = 1;
		String str = sc.next();
		List<Integer> array = new ArrayList<Integer>();

		for(int i = 0;i < num; i++) {
			array.add(Integer.valueOf(str.charAt(i)));
		}


		for(int j = 0; j < num -1 ;j++) {
			int compare = array.get(j).compareTo(array.get(j + 1));
			if(compare == -1) {
				lookAble += 1;
			}
		}

		System.out.println(lookAble);
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
		List<Integer> array = new ArrayList<Integer>();
		^
  symbol:   class List
  location: class Main
Main.java:8: error: cannot find symbol
		List<Integer> array = new ArrayList<Integer>();
		                          ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

public class Great_ocen {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int lookAble = 1;
		String str = sc.next();
		List<Integer> array = new ArrayList<Integer>();

		for(int i = 0;i < num; i++) {
			array.add(Integer.valueOf(str.charAt(i)));
		}


		for(int j = 0; j < num -1 ;j++) {
			int compare = array.get(j).compareTo(array.get(j + 1));
			if(compare == -1) {
				lookAble += 1;
			}
		}

		System.out.println(lookAble);
	}
}

Compiler output:
Main.java:1: error: class Great_ocen is public, should be declared in a file named Great_ocen.java
public class Great_ocen {
       ^
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Great_ocen
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Great_ocen
Main.java:9: error: cannot find symbol
		List<Integer> array = new ArrayList<Integer>();
		^
  symbol:   class List
  location: class Great_ocen
Main.java:9: error: cannot find symbol
		List<Integer> array = new ArrayList<Integer>();
		                          ^
  symbol:   class ArrayList
  location: class Great_ocen
5 errors
Language: C++

int main() { // input
int N; cin >> N;
vector<int> H(N);
for (int i = 0; i < N; ++i) {
cin >> H[i]; }
// compute
int ans = 0;
for (int i = 0; i < N; ++i) {
bool is_candidate = true;
for (int j = 0; j < i; ++j) {
if (H[j] > H[i]) { is_candidate = false; break;
} }
if (is_candidate) { ++ans;
} }
// output
cout << ans << endl; }

Compiler output:
a.cc: In function 'int main()':
a.cc:2:8: error: 'cin' was not declared in this scope
    2 | int N; cin >> N;
      |        ^~~
a.cc:3:1: error: 'vector' was not declared in this scope
    3 | vector<int> H(N);
      | ^~~~~~
a.cc:3:8: error: expected primary-expression before 'int'
    3 | vector<int> H(N);
      |        ^~~
a.cc:5:8: error: 'H' was not declared in this scope
    5 | cin >> H[i]; }
      |        ^
a.cc:11:5: error: 'H' was not declared in this scope
   11 | if (H[j] > H[i]) { is_candidate = false; break;
      |     ^
a.cc:16:1: error: 'cout' was not declared in this scope
   16 | cout << ans << endl; }
      | ^~~~
a.cc:16:16: error: 'endl' was not declared in this scope
   16 | cout << ans << endl; }
      |                ^~~~
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<vector<int>> data

  for(int i = 0; i<N; i++){
    for(int j = 0; j<N; j++){
      if(vec.at(i) <= vec.at(j)){
        vec.at(i).at(j) = 1;
      }
      else  vec.at(i).at(j) = 0;
    }
  }

  int counter;
  int sample;

  for(int i = 0; i<N; i++){
    for(int j=0; j<i; i++){
      sample *= vec.at(i).at(j)
    }
    if(sample==1){
      counter++;
    }
  }

  cout << counter <<endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> N;
      |   ^~~
a.cc:7:19: error: 'N' was not declared in this scope
    7 |   vector<int> vec(N);
      |                   ^
a.cc:14:3: error: expected initializer before 'for'
   14 |   for(int i = 0; i<N; i++){
      |   ^~~
a.cc:14:18: error: 'i' was not declared in this scope
   14 |   for(int i = 0; i<N; i++){
      |                  ^
a.cc:28:27: error: request for member 'at' in 'vec.std::vector<int>::at(((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   28 |       sample *= vec.at(i).at(j)
      |                           ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,sum;
  cin >>N;
  sum=1;
  vector <int> H;
  for (int i=0; i<N; i++){
    cin >>H.at(i);
    if (H.at(0)<=H.at(1){
      sum ++;
    }
    else{
      sum = sum;
    }
  cout << sum << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before '{' token
   11 |     if (H.at(0)<=H.at(1){
      |                         ^
      |                         ;
a.cc:14:5: error: expected primary-expression before 'else'
   14 |     else{
      |     ^~~~
a.cc:13:6: error: expected ')' before 'else'
   13 |     }
      |      ^
      |      )
   14 |     else{
      |     ~~~~
a.cc:11:8: note: to match this '('
   11 |     if (H.at(0)<=H.at(1){
      |        ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<cstdio>
using  namespace std;
int  main () {
  int a, arr[108], max, jum=0;
  scanf("%d", &a);
  for(int i=0; i<a; i++){
  scanf("%d", &arr[i]);
  }
  max=arr[0];
  for(int i=0; i<a; i++) {
   if (max<=arr[i]) {
    max=arr[i];
    jum++;
   }
  printf("%d\n", jum);
}

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

#include<iostream>
 
using namespace std;
 
int main(){
  int N;
  cin >> N;
  
  int H[i];
  for(int i = 0; i < N; i++) cin >> H[i];
  
  int MAX = 0;
  int cnt = 0;
  
  for(int i = 0; i < N; i++){
    if( MAX <= H[i] ){
      MAX = H[i];
      cnt++;
    }
  }
  
  cout << cnt << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
    9 |   int H[i];
      |         ^
a.cc:10:37: error: 'H' was not declared in this scope
   10 |   for(int i = 0; i < N; i++) cin >> H[i];
      |                                     ^
a.cc:16:16: error: 'H' was not declared in this scope
   16 |     if( MAX <= H[i] ){
      |                ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int[] H = new int[N];
		// Nコの高さが与えられる
		for(int i = 0; i< N; i++){
			H[i] = sc.nextInt();
		}
		
		int innNumber = 1;
		for(int i = 0; i< N; i++){	
			for(int j = 1; j< i+1; j++){
				if(H[j]-H[i]<0){
					break
				}
			}
			innNumber = innNumber + 1;
		}
		System.out.println(innNumber);
	}
}

Compiler output:
Main.java:17: error: ';' expected
					break
					     ^
1 error
Language: C

#include <stdio.h>
int main(){

    int n; //山の数
    int high[100][2]; 

    int i, j; //カウンタ変数
    int viewN =0; //海が見える旅館の数
    
//input
    scanf("%d", &n);
    for(i=0; i<n; i++){
        scanf("%d", &high[i][0]);
    }

//calc
    for(i=1; i<n; i++){
        for(j=0; j<i; j++){
            if(high[i][0] >high[j][0]){ //i番目の山がj番目(j<i)の山より高い
                high[i][1] +=1;
            }
        }
    }
//output
    for(i=0; i<n; i++){
        if(high[i][1]==i){
            viewN ++;
        }
    }
    printf("%d", viweN);
        
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:30:18: error: 'viweN' undeclared (first use in this function); did you mean 'viewN'?
   30 |     printf("%d", viweN);
      |                  ^~~~~
      |                  viewN
main.c:30:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int s[20],i,n,m;
  n=0;
  m=0;
  
  scanf("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",&s[1],&s[2].&s[3],&s[4],&s[5],&s[6],&s[7],&s[8],&s[9],&s[10],&s[11],&s[12],&s[13],&s[14],&s[15],&s[16],&s[17],&s[18],&s[19],&s[20]);
  
  for(i=0;i<20;i++){
      printf("i=%d,,,",i);
      if(s[i+1]>100) s[i+1]=0;
      if(s[m]<=s[i+1]){
          printf("sm=%dsi=%d,,",s[m],s[i+1]);
          n=n+1;
          m=m+1;
          printf("n=%d,m=%d,,",n,m);
      }
      
  }
  if(n==0) n=n+1;
  printf("%d",n);
}

Compiler output:
main.c: In function 'main':
main.c:7:64: error: expected identifier before '&' token
    7 |   scanf("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",&s[1],&s[2].&s[3],&s[4],&s[5],&s[6],&s[7],&s[8],&s[9],&s[10],&s[11],&s[12],&s[13],&s[14],&s[15],&s[16],&s[17],&s[18],&s[19],&s[20]);
      |                                                                ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  int x = 1;
  cin >> n;
  int h[n];
  for(int i = 0;i < n;i++){
    cin >> h[i];
  }
  int max = h[0];
  for(int j = 1;j < n;j+){
    if(h[j] >= max){
      max = h[j];
      x++;
    }else{
      break;
    }
  }
  cout << x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: expected primary-expression before ')' token
   12 |   for(int j = 1;j < n;j+){
      |                         ^
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Great_ocen {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int lookAble = 1;
		String str = sc.nextLine();
		List<Integer> array = new ArrayList<Integer>();

		for(int i = 0;i < num; i++) {
			array.add(Integer.valueOf(str.charAt(i)));
		}
		

		for(int j = 1; j < array.size();j++) {
			int compare = array.get(j).compareTo(array.get(j + 1));
			if(compare == -1) {
				lookAble += 1;
			}
		}

		System.out.println(lookAble);
	}
}

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

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  
  int k=0;
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t<num; t++){
      if (H[t] > H[s]){
        k+=1
        }}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: expected ';' before '}' token
   20 |         k+=1
      |             ^
      |             ;
   21 |         }}}
      |         ~
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  
  int k=0
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t<num; t++){
      if (H[t] > H[s]){
        k+=1
        }}}
    
  cout << k <<endl;
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected ',' or ';' before 'for'
   17 |   for(int s=0; s<num-1; s++){
      |   ^~~
a.cc:17:16: error: 's' was not declared in this scope
   17 |   for(int s=0; s<num-1; s++){
      |                ^
Language: C

#include <stdio.h>

int main() {
	int n, i[20], a, count = 1;

	scanf_s("%d", &n);
	if (n < 1 | n>20)return 0;
	for (a = 0; a < n; a++) {
		scanf_s("%d", &i[a]);
		if (i[a] < 1 | i[a]>20)return 0;
	}

	for (a = 1; a < n; a++) {
		if (i[0] <= i[a] & i[1] <= i[a] & i[a - 1] <= i[a])count++;
	}

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

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

#include<stdio.h>
int main(void){
  int N,p,k=1;
  scanf("%d",&N);
  int H[N];
  for(int n=0;n<N;n++){
  scanf("%d",&H[n]);
  }
  for(int m=1;m<N;m++){
    for(int d=m;d>0;d--){
    if(H[m]=<H[d-1]){
      break;
    }
      else{
      k=k+1;
      }
   }
  }
  printf("%d",k);
}

Compiler output:
main.c: In function 'main':
main.c:11:13: error: expected expression before '<' token
   11 |     if(H[m]=<H[d-1]){
      |             ^
Language: C++

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

int main() {
  int N;
  int X;
  int a;
  int i;
  X=1;
  cin >> N;
  vector<int> vec(101);
  
  for (int i = 1; i < N+1; i++) {
  cin >> vec.at(i);
  }
  
   if (vec.at(i) == *max_element(vec.begin(), vec.end())) {
      cout << i << endl;
     i=a;
     X++;
     }
  
   for (int k = 1; k < N+1; k++) {  
     
   if (vec.at(k) == *max_element(vec.begin(), vec.at(a))) {
      cout << a << endl;
     k=a;
     X++;
     }
     
  if (vec.at(k) == vec.at(k)) {
break;
     }
     
  }

   cout << X << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: no matching function for call to 'max_element(std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   25 |    if (vec.at(k) == *max_element(vec.begin(), vec.at(a))) {
      |                      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5641:5: note: candidate: 'template<class _FIter> constexpr _FIter std::max_element(_FIter, _FIter)'
 5641 |     max_element(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5641:5: note:   template argument deduction/substitution failed:
a.cc:25:33: note:   deduced conflicting types for parameter '_FIter' ('__gnu_cxx::__normal_iterator<int*, std::vector<int> >' and 'int')
   25 |    if (vec.at(k) == *max_element(vec.begin(), vec.at(a))) {
      |                      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5666:5: note: candidate: 'template<class _FIter, class _Compare> constexpr _FIter std::max_element(_FIter, _FIter, _Compare)'
 5666 |     max_element(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5666:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:524:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::max_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare)'
  524 | max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
      | ^~~~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:524:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:528:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::max_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator)'
  528 | max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
      | ^~~~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:528:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N, b, a, c;
    cin >> N;
   c = 0;
   a = 0;
for(i=0; i <= N; i++) {
    cin >> b;
    if(b>c) {
 a++;
b = c;
}
}
    else cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'i' was not declared in this scope
    9 | for(i=0; i <= N; i++) {
      |     ^
a.cc:16:5: error: 'else' without a previous 'if'
   16 |     else cout << a << endl;
      |     ^~~~
Language: C++

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

int main() {
	int  n,i, j, k = 1;
	cin >> n; 
	int az[20];
	for (i = 0; i = n - 1; i++) {
		cin >> az[i];
	}
	for (i = n; i = 19; i++) {
		az[i] = 0;
	}
	i = 0;
	while (az[i] < az[i+ 1]) {
		k++;
		i++;

	}
	cout << k << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n;
      |         ^~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << k << endl;
      |         ^~~~
a.cc:20:22: error: 'endl' was not declared in this scope
   20 |         cout << k << endl;
      |                      ^~~~
Language: C++

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

int main() {
  int N;
  int X;
  X=1;
  cin >> N;
  vector<int> vec(101);
  
  for (int i = 1; i < N+1; i++) {
  cin >> vec.at(i);
  }
  
   if (vec.at(i) == *max_element(vec.begin(), vec.end())) {
      cout << i << endl;
     i=a;
     X++;
     }
  
   for (int k = 1; k < N+1; k++) {  
     
   if (vec.at(k) == *max_element(vec.begin(), vec.at(a))) {
      cout << a << endl;
     k=a;
     X++;
     }
     
  if (vec.at(k) == vec.at(k)) {
break
     }
     
  }

   cout << X << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'i' was not declared in this scope
   15 |    if (vec.at(i) == *max_element(vec.begin(), vec.end())) {
      |               ^
a.cc:17:8: error: 'a' was not declared in this scope
   17 |      i=a;
      |        ^
a.cc:23:54: error: 'a' was not declared in this scope
   23 |    if (vec.at(k) == *max_element(vec.begin(), vec.at(a))) {
      |                                                      ^
a.cc:30:6: error: expected ';' before '}' token
   30 | break
      |      ^
      |      ;
   31 |      }
      |      ~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Great_ocen {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int lookAble = 1;
		String str = sc.nextLine();
		List<Integer> array = new ArrayList<Integer>();

		for(int i = 0;i < num; i++) {
			array.add(Integer.valueOf(str.charAt(i)));
		}

		for(int j = 1; j < array.size();j++) {
			if(array.get(j) < array.get(j +1 )) {
				lookAble += 1;
			}
		}

		System.out.println(lookAble);

	}
}

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

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  int k = H[0];
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t<num; t++){
      if (H[t] > H[s]){
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
        }}}
  for(int res=0; H[res]-k>=0; res++)
    {
    cout << res- << endl;
    }
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: expected primary-expression before '<<' token
   25 |     cout << res- << endl;
      |                  ^~
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  int k = H[0];
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t<num; t++){
      if (H[t] > H[s]){
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
        }}}
  for(int res=0; H[res]-k>=0; res++)
    {
    cout << res-=1 << endl;
    }
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   25 |     cout << res-=1 << endl;
      |                  ~~^~~~~~~
Language: C

include <stdio.h>
int main(void){
	int i,n,h,c,p;
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		scanf("%d ",&h);
		if(c<=h){
			c=h;
			p++;
		}
	}
	printf("%d",p);
    return 0;
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

#include <iostream>
int main(){
  int a;
  int b[20];
  int cnt,before;
  cin >> a;
  for(int i=0;i<a;i++){
    cin >> b[i];
  }
  cnt=1;
  before=b[0];
  for(int i=1;i<a;i++){
    if(before < b[i]){
      cnt++;
    }
    before == b[i];
  }
  cout << cnt <<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> a;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << cnt <<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout << cnt <<endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<stdio.h>
int main(void){
  int N,p,k=1;
  scanf("%d",N);
  int H[N];
  for(int n=0,n<N,n++){
  scanf("%d",H[n])
  }
  for(int m=1;m<N,m++){
    if(H[m]>H[m-1]){
      k=k+1;
    }
  }
  printf("%d",k);
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    6 |   for(int n=0,n<N,n++){
      |                ^
main.c:9:3: error: expected expression before 'for'
    9 |   for(int m=1;m<N,m++){
      |   ^~~
main.c:15:1: error: expected expression before '}' token
   15 | }
      | ^
main.c:15:1: error: expected expression before '}' token
Language: C++

#include <iostream.h>
int main(){
  int a;
  int b[20];
  int cnt,before;
  cin >> a;
  for(int i=0;i<a;i++){
    cin >> b[i];
  }
  cnt=1;
  before=b[0];
  for(int i=1;i<a;i++){
    if(before < b[i]){
      cnt++;
    }
    before == b[i];
  }
  cout << cnt <<endl;
  return 0;
}


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

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

int main(){
  vector<int> H(N);
  for (int i=0; i<N; i++) cin >> H.at(i);
  
  int j=0,res=0;
  int k;
  while (j<H.size()){
    k=0;
    while(H.at(k) <= H.at(j)){
    if (j=k) {
      res++;
      break;
    }
    k++;
    }
    j++;
  }
  cout << res<< endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'N' was not declared in this scope
    6 |   vector<int> H(N);
      |                 ^
Language: C++

#include <iostream.h>
#include<stdio.h>
int main(){
  int a;
  int b[20];
  int cnt,before;
  cin >> a;
  for(int i=0;i<a;i++){
    cin >> b[i];
  }
  cnt=1;
  before=b[0];
  for(int i=1;i<a;i++){
    if(before < b[i]){
      cnt++;
    }
    before == b[i];
  }
  printf("%d",cnt);
  return 0;
}


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

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

int main() {
  int n,s=1;
  cin >> n;
  vector<int> h(n);
  for(int i=0;i<n;i++){
    cin >> h.at(n);
    if(i==0) ma=h.at(0);
    else ma = max(ma,h.at(i));
    if(h.at(i)>ma) s++;
  }
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'ma' was not declared in this scope; did you mean 'fma'?
   10 |     if(i==0) ma=h.at(0);
      |              ^~
      |              fma
a.cc:11:10: error: 'ma' was not declared in this scope; did you mean 'fma'?
   11 |     else ma = max(ma,h.at(i));
      |          ^~
      |          fma
a.cc:12:16: error: 'ma' was not declared in this scope; did you mean 'fma'?
   12 |     if(h.at(i)>ma) s++;
      |                ^~
      |                fma
Language: Java

import java.util.*;

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

        int num = sc.nextInt();
        int[] hotel = new int[num];
        int i;
        for(i=0; i < num ;i++)
            hotel[i] = sc.nextInt();

        int ans = 0;
        int p = 0;

        for(int j =0; j<num ; j++){
            for(int k = j;k>0;k--){
                if(hotel[j] >= hotel[k]){
                    p = p+1;
                    System.out.println(p);
                }else{
                    p = 0;
                }
            if(p==j) {
                ans = ans + 1;
            }else{
                p = 0;
            }
            }
        }

        System.out.println(ans);
    }
}

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

#include <stdio.h>
#include <stdlib.h>

int main()
{
	char temp[4];
	int n,h[21],i=0,can=1;
	scanf("%2s",temp);
	n=atoi(temp);
	if(n>20||n<1)
	   return 1;
	for(i=0;i<n;i++)
	{
		scanf("%3s",temp);
		h[i]=atpi(temp);
		if(h[i]<1||h[i]>100)
		   return 1;
	}
	for(i=1;i<n;i++)
	{
		if(h[i]>h[i-1])
		{
			can++;
		}
		else
		{
			h[i]=h[i-1];
		}
	}
	printf("%d",can);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:22: error: implicit declaration of function 'atpi'; did you mean 'atoi'? [-Wimplicit-function-declaration]
   15 |                 h[i]=atpi(temp);
      |                      ^~~~
      |                      atoi
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i];
      }
  int k = H[0]
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t<num; t++){
      if (H[t] > H[s]){
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
        }}}
  for(int res=0; H[res]>=k; res++)
    {
    cout << res-1 << endl;
    }
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for(int s=0; s<num-1; s++){
      |   ^~~
a.cc:16:16: error: 's' was not declared in this scope
   16 |   for(int s=0; s<num-1; s++){
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0; i<num; i++){
    cin >> H[i]
      }
  int k = H[0]
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t<num; t++){
      if (H[t] > H[s]){
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
        }}}
  for(int res=0; H[res]>=k; res++)
    {
    cout << res-1 << endl;
    }
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before '}' token
   12 |     cin >> H[i]
      |                ^
      |                ;
   13 |       }
      |       ~         
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for(int s=0; s<num-1; s++){
      |   ^~~
a.cc:16:16: error: 's' was not declared in this scope
   16 |   for(int s=0; s<num-1; s++){
      |                ^
Language: C++

#include<iostream>
using namespace std;

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

    int H[N];

    for(int i = 0; i < N; i++)
    {
        int n;
        cin >> n;
        H[i] = n;
    }

    for(int i = 0; i < N; i++)
    {
        if( i == 0 || h <= H[i])
        {
            h = H[i];
            t++;
        }

    }

    cout << t << endl;

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

#include <stdio.h>

int main()
{
	int n,h[21],i=0,can=1;
	scanf("%d",&n);
	if(n>20||n<1)
	   return 1;
	for(i=0;i<n;i++)
	{
		scanf("%d",&h[i]);
		if(h[i]<1||h[i]>100)
	}
	for(i=1;i<n;i++)
	{
		if(h[i]>h[i-1])
		{
			can++;
		}
		else
		{
			h[i]=h[i-1];
		}
	}
	printf("%d",can);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:9: error: expected expression before '}' token
   13 |         }
      |         ^
Language: C++

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

int main(){
  int val,i,Mt,inn,Max;
  inn = 1;
  cin >> val;
  int hight[val];
  for(i=0;i<val;i++){
  	cin >> Mt;
    hight[i] = Mt;
  }
  Max = hight[0];
  for(i=0;i<val;i++){
    if(Max<=hight[i]) {
      inn++;
      hight = Max;
    }
  }
  cout << inn << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: incompatible types in assignment of 'int' to 'int [val]'
   17 |       hight = Max;
      |       ~~~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  
  for(int i=0 i<num; i++){
    cin >> H[i]
      }
  int k = H[0]
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t++){
      if (H[t] > H[s]){
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
        }}}
  for(int res=0; H[res]>=k; res++)
    {
    cout << res-1 << endl;
    }
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before 'i'
   11 |   for(int i=0 i<num; i++){
      |              ^~
      |              ;
a.cc:12:16: error: expected ';' before '}' token
   12 |     cin >> H[i]
      |                ^
      |                ;
   13 |       }
      |       ~         
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for(int s=0; s<num-1; s++){
      |   ^~~
a.cc:16:16: error: 's' was not declared in this scope
   16 |   for(int s=0; s<num-1; s++){
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main()
  {
  int N;
  cin >> N;
  const int num = N
  int H[num];
  
  for(int i=0 i<num; i++){
    cin >> H[i]
      }
  int k = H[0]
  
  for(int s=0; s<num-1; s++){
    for(int t=s+1; t++){
      if (H[t] > H[s]){
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
        }}}
  for(int res=0; H[res]>=k; res++)
    {
    cout << res-1 << endl;
    }
  
  return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'int'
    9 |   int H[num];
      |   ^~~
a.cc:11:14: error: expected ';' before 'i'
   11 |   for(int i=0 i<num; i++){
      |              ^~
      |              ;
a.cc:12:12: error: 'H' was not declared in this scope
   12 |     cin >> H[i]
      |            ^
a.cc:14:11: error: 'H' was not declared in this scope
   14 |   int k = H[0]
      |           ^
a.cc:16:16: error: 's' was not declared in this scope
   16 |   for(int s=0; s<num-1; s++){
      |                ^
Language: C++

#include <vector>
#include <cstdio>

using std;

int main()
{
  int n=0;
  scanf("%d", &n);
  vector<int> v;
  for(int i=0; i<n; ++i) {
    int data=0;
    scanf("%d", &data);
    v.push_back(data);
  }
  int ans=1;
  int acc=v[0];
  for(int i=1; i<n; ++i) {
    if (v[i] >= acc) {
      acc = v[i];
      ++ans;
    }
  }
  printf("%d", ans);
  return 0;
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'std'
    4 | using std;
      |       ^~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<int> v;
      |   ^~~~~~
a.cc:10:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> v;
      |          ^~~
a.cc:14:5: error: 'v' was not declared in this scope
   14 |     v.push_back(data);
      |     ^
a.cc:17:11: error: 'v' was not declared in this scope
   17 |   int acc=v[0];
      |           ^