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

#inclue<stdio.h>
int main(void){
  int n,count,number,p[20];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
      scanf("%d",&p[i]);
  }
  count=0;
  for(int i=1;i<n;i++){
      if((p[i]>p[i-1]&&p[i]<p[i+1])||(p[i]>p[i+1]&&p[i]<p[i-1])){
          count++;
      }
  }
  printf("%d\n",count);

  return 0;
}
            

   

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inclue<stdio.h>
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |   printf("%d\n",count);
      |   ^~~~~~
main.c:14:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#inclue<stdio.h>
int main(void){
  int n,count,number,p[20];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
        scanf("%d",&p[i]);
    }
    count=0;
    for(int i=1;i<n;i++){
        if((p[i]>p[i-1]&&p[i]<p[i+1])||(p[i]>p[i+1]&&p[i]<p[i-1])){
            count++;
        }
    }
    printf("%d\n",count);

    return 0;
}
            

   

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inclue<stdio.h>
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |     printf("%d\n",count);
      |     ^~~~~~
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#inclue<stdio.h>
int main(void){
  int n,count,number,p[20];
  scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&p[i]);
    }
    count=0;
    for(int i=1;i<n;i++){
        if((p[i]>p[i-1]&&p[i]<p[i+1])||(p[i]>p[i+1]&&p[i]<p[i-1])){
            count++;
        }
    }
    printf("%d\n",count);

    return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inclue<stdio.h>
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |     printf("%d\n",count);
      |     ^~~~~~
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector <int> v(n);
	for (auto &x : v){
		cin >> x;
	}
	int res = 0;
	int i = 1;
	while (i < n - 1){
		int tmp = v[i] + v[i-1] + v[i+1];
		int maxx = max(v[i], max(v[i-1], v[i+1]));
		int minn = min(v[i], min(v[i-1], v[i+1]));		
		if (tmp - maxx - minn == v[i]){
			++res;
		}       a
		++i;
	}
	cout << res;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'a' was not declared in this scope
   22 |                 }       a
      |                         ^
Language: C++

#include<bits/stdc++>
using namespace std;
int main(){
  int n;
  int a[n];
  int mi=0,smi=0;
  for(int i=0;i<n;i++){
    cin >> a[n];
    if(a[n]<mi){
      smi=mi;
      mi=a[n];
    }
  }
  cout << smi << endl;
}
  

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

#include<bits/stdc++>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a(n);
  }
  sort(a.begin(),a.end());
  cout << a(1) << end;
}

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

 #include <iostream>
 using namespace std;

 int main() {
 int n;
 cin >> n;
 vector<int> p(n);
 for(int i = 0; i < n; i++) cin >> p[i];
 int ans = 0;
 for(int i = 1; i < n - 1; i++) {
 if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
 else if((p[i - 1] > p[i]) && (p[i] > p[i + 1])) ans++;
 }
 cout << ans << endl;
 return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:2: error: 'vector' was not declared in this scope
    7 |  vector<int> p(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:7:9: error: expected primary-expression before 'int'
    7 |  vector<int> p(n);
      |         ^~~
a.cc:8:36: error: 'p' was not declared in this scope
    8 |  for(int i = 0; i < n; i++) cin >> p[i];
      |                                    ^
a.cc:11:6: error: 'p' was not declared in this scope
   11 |  if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
      |      ^
Language: C++

#include <iostream>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector <int> p(N);
    for (int i=1; i< N; i++){
        cin >> p.at(i);
    }
     int l= 0;
    for (int i= 1; i< N-1; i++){
        if (p.at(i)> p.at(i+1) && p.at(i)< p.at(i-1)){
         l++;
        }
          else if (p.at(i)< p.at(i+1) && p.at(i)> p.at(i-1)){
            l++;
        }
        cout << l << endl; 
    }
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector <int> p(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:13: error: expected primary-expression before 'int'
    6 |     vector <int> p(N);
      |             ^~~
a.cc:8:16: error: 'p' was not declared in this scope
    8 |         cin >> p.at(i);
      |                ^
a.cc:12:13: error: 'p' was not declared in this scope
   12 |         if (p.at(i)> p.at(i+1) && p.at(i)< p.at(i-1)){
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N;
    cin >> N;
    vector <int> p(N);
    for (int i=1; i< N; i++){
        cin >> p.at(i)
    }
    for (int i= 1; i< N-1; i++){
        int j= i-1;
        int k= i+1;
        int l= 0;
        if (p.at(i)> p.at(j) && p.at(i)< p.at(k)){
         l++;
        }
          else if (p.at(i)< p.at(j) && p.at(i)> p.at(k)){
            l++;
        }
       
    }
    cout << l << endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: expected ';' before '}' token
    8 |         cin >> p.at(i)
      |                       ^
      |                       ;
    9 |     }
      |     ~                  
a.cc:22:13: error: 'l' was not declared in this scope
   22 |     cout << l << endl;
      |             ^
Language: C++

#include <stdio.h>
int main(void){
	int n,cnt=0;
    scanf_s("%d",&n);
    int* p = new int[n];
  	for(int i=0;i<n;i++){
    	scanf("%d",&p[i]);
    }
  	for(int i=2;i<n-1;i++){
    	if((p[i-1]>p[i]&&p[i+1]<p[i])||(p[i-1]<p[i]&&p[i+1]>p[i])){
        	cnt++;
        }
    }
  	printf("%d",cnt);
  	return 0;
}

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

#include <stdio.h>
int main(void){
	int n,cnt=0;
    scanf_s("%d",&n);
    int* p = new int[n];
  	for(int i=2;i<n-1;i++){
    	if((p[i-1]>p[i]&&p[i+1]<p[i])||(p[i-1]<p[i]&&p[i+1]>p[i])){
        	cnt++;
        }
    }
  	printf("%d",cnt);
  	return 0;
}

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

#include <stdio.h>
int main(void){
	int n,cnt;
    scanf_s("%d",n);
    int* p = new int[n];
  	for(int i=1;i<n-1;i++){
    	if((p[i-1]>p[i]&&p[i+1]<p[i])||(p[i-1]<p[i]&&p[i+1]>p[i])){
        	cnt++;
        }
    }
  	printf("%d",cnt);
  	return 0;
}

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

#include <stdio.h>
int main void{
	int n,cnt;
    scanf_s("%d",&n);
    int* p = new int[n];
  	for(int i=2;i<n-1;i++){
    	if((p[i-1]>p[i]&&p[i+1]<p[i])||(p[i-1]<p[i]&&p[i+1]>p[i])){
        	cnt++;
        }
    }
  	printf("%d",cnt);
  	return 0;
}

Compiler output:
a.cc:2:10: error: expected initializer before 'void'
    2 | int main void{
      |          ^~~~
Language: C++

n = int(input())
p = list(map(int, input().split()))

count = 0

for i in range(1, n-1):
    n3 = [
            p[i-1],
            p[i],
            p[i+1]
        ]
    n3.sort()
   
    if n3[1] == p[i]:
        count += 1
print(count)

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

#include <iostream>
using namespace std;

int main(){

    int n;
    cin >> n;
  
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    
    int ans = 0;
    for (int i = 1; i < n - 1; i++) if((a[i-1] > a[i]) ^ (a[i] < a[i+1])) ans++;
  
    cout << ans << endl;
  
    return 0;

}

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

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

int main()
{
    int n,i,ans=0;
    scanf("%d",&n);
  　int p[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&p[i]);
    }
    for(i=1;i<n-1;i++)
    {
        if(p[i-1]<p[i]&&p[i]<p[i+1]) ans++;
        else if(p[i-1]>p[i]&&p[i]>p[i+1]) ans++;
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:3: error: stray '\343' in program
    9 |   <U+3000>int p[n];
      |   ^~~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <climits>
#include <math.h>
#include <bitset>

#define P pair
#define X first
#define Y second
#define VSORT(v) sort(v.begin(), v.end())
#define VREV(v) reverse(v.begin(), v.end())
#define VMAX_P(v) max_element(v.begin(), v.end())
#define VMIN_P(v) min_element(v.begin(), v.end())
#define VMAX_IDX(v) distance(v.begin(), VMAX_P(v))
#define VMIN_IDX(v) distance(v.begin(), VMIN_P(v))
#define VCOPY(src, dst) copy(src.begin(), src.end(), back_inserter(dst))
#define SUPPER(src, dst) transform(src.begin(), src.end(), dst.begin(), toupper);
#define SLOWER(src, dst) transform(src.begin(), src.end(), dst.begin(), tolower);

using namespace std;
using ll = long long;

int main(int argc, const char *argv[])
{
    int n, cnt = 0;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        if (i < 2)
        {
            continue;
        }
        if (v[i - 1] != min(v[i], min(v[i - 1], v[i - 2]])) && v[i - 1] != max(v[i], max(v[i - 1], v[i - 2]])))
        {
            cnt++;
        }
    }
    cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:43:57: error: expected ')' before ']' token
   43 |         if (v[i - 1] != min(v[i], min(v[i - 1], v[i - 2]])) && v[i - 1] != max(v[i], max(v[i - 1], v[i - 2]])))
      |                                      ~                  ^
      |                                                         )
a.cc:43:57: error: expected ')' before ']' token
   43 |         if (v[i - 1] != min(v[i], min(v[i - 1], v[i - 2]])) && v[i - 1] != max(v[i], max(v[i - 1], v[i - 2]])))
      |            ~                                            ^
      |                                                         )
a.cc:43:57: error: expected primary-expression before ']' token
Language: C++

#include<stdio.h>
#include<iostream>

using namespace std;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int n;
  cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; ++i){
    cin >> v[i];
  }
  
  int res = 0;
  for(int i = 1; i < n - 2; ++i){
    if(v[i] > v[i + 1] && v[i] < v[i - 1]){
      ++res;
    }else if(v[i] < v[i + 1] && v[i] > v[i - 1]){
      ++res;
    }
  }
    
  cout << res << "\n";
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'vector' was not declared in this scope
   12 |   vector<int> v(n);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<iostream>
  +++ |+#include <vector>
    3 | 
a.cc:12:10: error: expected primary-expression before 'int'
   12 |   vector<int> v(n);
      |          ^~~
a.cc:14:12: error: 'v' was not declared in this scope
   14 |     cin >> v[i];
      |            ^
a.cc:19:8: error: 'v' was not declared in this scope
   19 |     if(v[i] > v[i + 1] && v[i] < v[i - 1]){
      |        ^
Language: C++

#include<iostream>

int main(){
    int n;

    std::vector<int> p(n);

    std::cin >> n;
    for(int a = 0; a < n; a++){
        std::cin >> p[a];
    }

    int ans = 0;

    for(int a = 1; a <= n - 1; a++){
        if(p[a - 1] > p[a] && p[a] > p[a + 1]){
            ans++;
        }else if(p[a + 1] > p[a] && p[a] > p[a - 1]){
            ans++;
        }
    }

    std::cout << ans << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'vector' is not a member of 'std'
    6 |     std::vector<int> p(n);
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | 
a.cc:6:17: error: expected primary-expression before 'int'
    6 |     std::vector<int> p(n);
      |                 ^~~
a.cc:10:21: error: 'p' was not declared in this scope
   10 |         std::cin >> p[a];
      |                     ^
a.cc:16:12: error: 'p' was not declared in this scope
   16 |         if(p[a - 1] > p[a] && p[a] > p[a + 1]){
      |            ^
Language: C++

yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
ttttttttttttttttttttttt
uuuuuuuuuuuuuuuuuuuuuu
gffffffffffffffff
yhjjjjjyhyjgguj
tyyyyyyyy
rrrrrr
eeee
ww
q

Compiler output:
a.cc:1:1: error: 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' does not name a type
    1 | yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	int n;
	cin >> n;
	int p[n];
	for (int i = 0; i < n; i++) {
		cin >> p[i];
	}
	
	int count = 0;
	for (int i = 1; i < n - 1; i++) {
		if ((p[i-1] < p[i]) && (p[i] < p[i+1])) {
			count++;
		} else if ((p[i-1] > p[i]) && (p[i] > p[i+1]) {
			count++;
		}
	}
	
	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:16:62: error: expected ')' before '{' token
   16 |                 } else if ((p[i-1] > p[i]) && (p[i] > p[i+1]) {
      |                           ~                                  ^~
      |                                                              )
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^
Language: C++

#include<iostream>

int main(){
	int n,a,b,c,k;
  	std::cin >> n;
  	std::cin >> a;
  	std::cin >> b;
  	k=0;
  	for(int i=0;i<n;i++){
      	std::cin>>c;
 		if(a<b){
          	if(b<c){
              k++;
        }} else {
        if(b>c){
          k++;
        }}
      		a=b;
      		b=c;	
          std::cin >> c;
    }
  	cout<<k<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |         cout<<k<<endl;
      |         ^~~~
      |         std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |         cout<<k<<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 <bits/stdc++.h>

using namespace std;

int main(){
  int n; cin >> n;
  int a[n];
  
  for(int i=0 ; i<n ; i++){
    cin >> a[i];
  }
  
  int cnt = 0;
  for(int i=1 ; i<n-1 ; i++){
    maxa = max({a[i-1],a[i],a[i+1]});
    mina = min({a[i-1],a[i],a[i+1]});
    
    if(a[i] != maxa and a[i] != mina) cnt++;
  }
  
  cout << cnt << endl;
}
    
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'maxa' was not declared in this scope
   15 |     maxa = max({a[i-1],a[i],a[i+1]});
      |     ^~~~
a.cc:16:5: error: 'mina' was not declared in this scope
   16 |     mina = min({a[i-1],a[i],a[i+1]});
      |     ^~~~
Language: C

#include<stdio.h>

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

  for(i=0;i<n-2;i++){
    if((p[i]<p[i+1])&&(p[i+1]<p[i+2])){
      count+=1;
    }
    else if((p[i]>p[i+1])&&(p[i+1]>p[i+2])){
      count+=1;
    }
  }

  cout<<count<<endl;;

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:3: error: 'cout' undeclared (first use in this function); did you mean 'count'?
   20 |   cout<<count<<endl;;
      |   ^~~~
      |   count
main.c:20:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:16: error: 'endl' undeclared (first use in this function)
   20 |   cout<<count<<endl;;
      |                ^~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  int count = 0;
  for (int i = 1; i < n-1; i++) {
    int p;
    cin >> p; 
    if (p[i-1] < p[i] && p[i] < p[i+1]) {
      count++;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: invalid types 'int[int]' for array subscript
   11 |     if (p[i-1] < p[i] && p[i] < p[i+1]) {
      |          ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
   11 |     if (p[i-1] < p[i] && p[i] < p[i+1]) {
      |                   ^
a.cc:11:27: error: invalid types 'int[int]' for array subscript
   11 |     if (p[i-1] < p[i] && p[i] < p[i+1]) {
      |                           ^
a.cc:11:34: error: invalid types 'int[int]' for array subscript
   11 |     if (p[i-1] < p[i] && p[i] < p[i+1]) {
      |                                  ^
Language: C

#include<stdio.h>

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

  for(i=0;i<n-1;i++){
    if((p[i]<p[i+1])&&(p[i+1]<p[i+2])){
      count+=1;
    }
    else if((p[i]>p[i+1])&&(p[i+1]>p[i+2])){
      count+=1;
    }
  }

  printf("%d",count);

  return 0;
}


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

//ifの条件式をもっと短くしたい//
//説明用//
#include <iostream>
using namespace std;
int main(){
	int n;//順列の要素の個数
    int ans=0;//条件を満たす個数
	cin >> n;
	int P[n];
  	for(int i = 0;i<n;i++){
    	cin >> P[i];
    }
  	for(int i = 1;i < n-1;i++)
    	if(P[i-1] < P[i]&&P[i] < P[i+1] || P[i-1] > P[i]&&P[i] > P[i+1]){
        ans +=1;
          
             
        }
    }
  	cout << ans;
}

Compiler output:
a.cc:20:9: error: 'cout' does not name a type
   20 |         cout << ans;
      |         ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:9:15: error: stray '\' in program
    9 |     scanf("%d"\n",b[i]);
      |               ^
main.c:9:15: error: expected ')' before 'n'
    9 |     scanf("%d"\n",b[i]);
      |          ~    ^~
      |               )
main.c:9:17: warning: missing terminating " character
    9 |     scanf("%d"\n",b[i]);
      |                 ^
main.c:9:17: error: missing terminating " character
    9 |     scanf("%d"\n",b[i]);
      |                 ^~~~~~~~
main.c:16:6: error: expected ';' before '}' token
   16 |     }
      |      ^
      |      ;
   17 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main ()
  {
int n, i, cnt = 0;
cin >> n;
int a[n+1];
for(i = 1; i <= n; i++)
  {
  cin >> arr[i];
  }
for(i = 2; i < n; i++)
  {
if((a[i] > a[i-1] or a[i] > a[i+1]) and (a[i] < a[i-1] or a[i] < a[i+1])) cnt++;
  }
  cout << cnt << endl;
  }

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

int main() {
	ll a;
	vector <ll> arr;
	ll count=0;
	arr.resize(a);
	for (int x=0;x<a;x++){
		cin >> arr[x];
	}
	for (int x=1;x<(a-1);x++){
		if (((arr[x]>arr[x-1])&&(arr[x]<arr[x+1]))||((arr[x]<arr[x-1])&&(arr[x]>arr[x+1])){
			count +=1;
		}
	}
	cout << count ;
}	




Compiler output:
a.cc: In function 'int main()':
a.cc:15:99: error: expected ')' before '{' token
   15 |                 if (((arr[x]>arr[x-1])&&(arr[x]<arr[x+1]))||((arr[x]<arr[x-1])&&(arr[x]>arr[x+1])){
      |                    ~                                                                              ^
      |                                                                                                   )
a.cc:18:9: error: expected primary-expression before '}' token
   18 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

int main() {
	ll a;
	vector<ll> arr;
	ll count=0;
	arr.resize(a);
	for (int x=0;x<a;x++){
		cin >> arr[x]
	}
	for (int x=1;x<a-1;x++){
		if ((arr[x]>arr[x-1])&&(arr[x]<arr[x+1])){
			count +=1;
		}
	}
	cout << count ;
}	


Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before '}' token
   12 |                 cin >> arr[x]
      |                              ^
      |                              ;
   13 |         }
      |         ~
Language: C++

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

int main()
{
  int n, ans;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for(int i = 1; i < n - 1; i++) {
  if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
  else if((p[i - 1] > p[i]) && (p[i] > p[i + 1])) ans++;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'p' was not declared in this scope
   12 |   if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
      |       ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected ',' or ';' before 'vector'
    7 |     vector <int> p(N);
      |     ^~~~~~
a.cc:9:16: error: 'p' was not declared in this scope
    9 |         cin >> p.at(i);
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main() {
int n;
cin >> n;
vector<int> p(n);
for(int i = 0; i < n; i++) cin >> p[i];
int ans = 0;
for(int i = 1; i < n - 1; i++) {
if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
else if((p[i - 1] > p[i]) && (p[i] > p[i + 1])) ans++;
}
cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'vector' was not declared in this scope
    7 | vector<int> p(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:7:8: error: expected primary-expression before 'int'
    7 | vector<int> p(n);
      |        ^~~
a.cc:8:35: error: 'p' was not declared in this scope
    8 | for(int i = 0; i < n; i++) cin >> p[i];
      |                                   ^
a.cc:11:5: error: 'p' was not declared in this scope
   11 | if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
      |     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	
	std::vector<int> p(n);
	for (int i=0;i<n;++i) {
		cin >> p.at(i);
	}
	
	int count = 0;
	for (int i=0;i<n-2;++i) {
		if ((p.at(i) < p.at(i+1) && p.at(i+1) < p.at(i+2)) || (p.at(i) > p.at(i+1) && p.at(i+1) > p.at(i+2)) {
			count++;
		}
	}
	
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:117: error: expected ')' before '{' token
   16 |                 if ((p.at(i) < p.at(i+1) && p.at(i+1) < p.at(i+2)) || (p.at(i) > p.at(i+1) && p.at(i+1) > p.at(i+2)) {
      |                    ~                                                                                                ^~
      |                                                                                                                     )
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else    A == A;
      |         ^~~~
Language: C++


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


int main(){
    int n;
    cin >> n;
    vector<int>x(n);
    for(int i = 0; i < n; i++){
      cin >> V.at(i);
    }
    int ans = 0;
    for(int i = 0; i<n; i++){
      if(V.at(i) >1 && V.at(i) < n){
        ans++;
      }
    }
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: 'V' was not declared in this scope
   14 |       cin >> V.at(i);
      |              ^
a.cc:18:10: error: 'V' was not declared in this scope
   18 |       if(V.at(i) >1 && V.at(i) < n){
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main();{
  int n,k=0;cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++)cin>>a.at(i);
  for(int j=1;j<n-1;j++){
    int x=a.at(j-1),y=a.at(j+1);
    if(a.at(j)>min(x,y)&&a.at(j)<max(x,y))k++;
  }
cout<<k<<endl;
}

Compiler output:
a.cc:3:12: error: expected unqualified-id before '{' token
    3 | int main();{
      |            ^
Language: C++

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

int main(){
    int N , A;
    cin >> N;
    vector<int> vec(100);
    for(int i = 0; i < N - 2; i++){
        cin >> vec.at(i) >> vec.at(i+1) >> vec.at(i+2);
        if (vec.at(i) > vec.at(i + 1)  >vec.at(i + 2));
            A ++;
        if (vec.at(i + 2) > vec.at(i + 1) >vec.at(i));
            A ++;
        else ;;
    }
    cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else ;;
      |         ^~~~
Language: C++

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

int main(){
    int N , A;
    cin >> N;
    vector<int> vec(100);
    for(int i = 0; i < N - 2; i++){
        cin >> vec.at(i) >> vec.at(i+1) >> vec.at(i+2);
        if (vec.at(i) > vec.at(i + 1)  >vec.at(i + 2));
            A ++;
        if (vec.at(i + 2) > vec.at(i + 1) >vec.at(i));
            A ++;
        else
            A == A;
    }
    cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else
      |         ^~~~
Language: C

#include <stdio.h>
int main(){
  int i, j=0, tmp,a;
 
  /* 数値の総数を入力 */
  int total;
  scanf("%d", &total);
  int number[total-1];
 
  /* 配列に格納する数値を入力 */
  for (i=0; i<total; i++)
    scanf("%d", &number[i]);
    for(i=0;i<(total-2);i++){
        if(number[i]<number[i+1]&&number[i+1]<number[i+2]){
            j++;
        }else if(number[i+1]<number[i]&&number[i+1]>number[i+2]){
            j++;
    }
    printf("%d",j);
    return 0;
}

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

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n;
cin>>n;
  vector<int> p(n);
for(int i=0;i<n;i++)
cin>>p[i];

int cnt=0;
for(int i=0;i<n-2;i++)
if((p[i]<p[i+1])&&(p[i+1]<p[i+2])
cnt++;

cout<<cnt<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:34: error: expected ';' before 'cnt'
   13 | if((p[i]<p[i+1])&&(p[i+1]<p[i+2])
      |                                  ^
      |                                  ;
   14 | cnt++;
      | ~~~                               
a.cc:16:16: error: expected ')' before ';' token
   16 | cout<<cnt<<endl;
      |                ^
      |                )
a.cc:13:3: note: to match this '('
   13 | if((p[i]<p[i+1])&&(p[i+1]<p[i+2])
      |   ^
Language: C++

// #include<bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int n;
    cin >>n;
    vector<int> num(n);
    vector<int> copy;
    
    for(int i=0; i<n; i++){
        cin >> num[i];
    }
    int cnt= 0;
    for(int i=0; i<n-2; i++){
        int a= num[i+1];
        copy= num;
        for(int a:copy) cerr << a <<" ";
        cerr << endl;
        sort(copy.begin()+i,copy.begin()+i+3);
        for(int a:copy) cerr << a <<" ";
        cerr << endl;
        if(a==copy[i+1]) cnt++;
    }
    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >>n;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:18:25: error: 'cerr' was not declared in this scope
   18 |         for(int a:copy) cerr << a <<" ";
      |                         ^~~~
a.cc:18:25: note: 'std::cerr' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:9: error: 'cerr' was not declared in this scope
   19 |         cerr << endl;
      |         ^~~~
a.cc:19:9: note: 'std::cerr' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:17: error: 'endl' was not declared in this scope
   19 |         cerr << endl;
      |                 ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<algorithm>
  +++ |+#include <ostream>
    4 | using namespace std;
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << cnt << endl;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << cnt << endl;
      |                    ^~~~
a.cc:25:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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


bool a[20]={0};

int main(){
	int n,p[20];
	cin>>n;
	for (int i =0;i<n;i++) cin>>p[i];
	
	for(int i =0;(i+2)<n;i++){
		int sum =(p[i]+p[i+1]+p[i+2]);
		int c = abs(p[i]-sum);
		if (abs(p[i+1]-sum)<c){
			c= abs(p[i+1]-sum);
			if(abs(p[i+2]-sum)<c)
				a[i+2]={1};
			else
				a[i+1]={1};
		}		
		else if (abs(p[i+2]-sum)<c){
			c=abs(p[i+2]-sum)ㄤ
			if(abs(p[i+1]-sum)<c)
				a[i+1]={1};
			else
				a[i+2]={1};
		}
		else 
			a[i]={1};
	}
	
	int cnt=0;
	for(int i=0;i<n;i++){
		if(a[i])
			cnt++;
	}
	cout<<cnt<<"\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:42: error: expected ';' before '\U00003124'
   24 |                         c=abs(p[i+2]-sum)ㄤ
      |                                          ^~
      |                                          ;
a.cc:27:25: error: expected '}' before 'else'
   27 |                         else
      |                         ^~~~
a.cc:23:44: note: to match this '{'
   23 |                 else if (abs(p[i+2]-sum)<c){
      |                                            ^
a.cc:30:17: error: 'else' without a previous 'if'
   30 |                 else
      |                 ^~~~
a.cc:31:27: error: 'i' was not declared in this scope
   31 |                         a[i]={1};
      |                           ^
a.cc: At global scope:
a.cc:35:9: error: expected unqualified-id before 'for'
   35 |         for(int i=0;i<n;i++){
      |         ^~~
a.cc:35:21: error: 'i' does not name a type
   35 |         for(int i=0;i<n;i++){
      |                     ^
a.cc:35:25: error: 'i' does not name a type
   35 |         for(int i=0;i<n;i++){
      |                         ^
a.cc:39:9: error: 'cout' does not name a type
   39 |         cout<<cnt<<"\n";
      |         ^~~~
a.cc:40:9: error: expected unqualified-id before 'return'
   40 |         return 0;
      |         ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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


bool a[20]={0};

int main(){
	int n,p[20];
	cin>>n;
	for (int i =0;i<n;i++) cin>>p[i];
	
	for(int i =0;(i+2)<n;i++){
		int sum =(p[i]+p[i+1]+p[i+2]);
		int c = abs(p[i]-sum);
		if (abs(p[i+1]-sum)<c){
			c= abs(p[i+1]-sum);
			if(abs(p[i+2]-sum)<c)
				a[i+2]={1};
			else
				a[i+1]={1};
		}		
		else if (abs(p[i+2]-sum)<c){
			c=abs(p[i+2]-sum)
			if(abs(p[i+1]-sum)<c)
				a[i+1]={1};
			else
				a[i+2]={1};
		}
		else 
			a[i]={1};
	}
	
	int cnt=0;
	for(int i=0;i<n;i++){
		if(a[i])
			cnt++;
	}
	cout<<cnt<<"\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:42: error: expected ';' before 'if'
   24 |                         c=abs(p[i+2]-sum)
      |                                          ^
      |                                          ;
   25 |                         if(abs(p[i+1]-sum)<c)
      |                         ~~                
a.cc:27:25: error: expected '}' before 'else'
   27 |                         else
      |                         ^~~~
a.cc:23:44: note: to match this '{'
   23 |                 else if (abs(p[i+2]-sum)<c){
      |                                            ^
a.cc:30:17: error: 'else' without a previous 'if'
   30 |                 else
      |                 ^~~~
a.cc:31:27: error: 'i' was not declared in this scope
   31 |                         a[i]={1};
      |                           ^
a.cc: At global scope:
a.cc:35:9: error: expected unqualified-id before 'for'
   35 |         for(int i=0;i<n;i++){
      |         ^~~
a.cc:35:21: error: 'i' does not name a type
   35 |         for(int i=0;i<n;i++){
      |                     ^
a.cc:35:25: error: 'i' does not name a type
   35 |         for(int i=0;i<n;i++){
      |                         ^
a.cc:39:9: error: 'cout' does not name a type
   39 |         cout<<cnt<<"\n";
      |         ^~~~
a.cc:40:9: error: expected unqualified-id before 'return'
   40 |         return 0;
      |         ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:38: error: expected ']' before numeric constant
   10 |     if((b[i]<b[i+1]) && (b[i+1]<b[i++2])){
      |                                      ^
      |                                      ]
Language: Java

import java.util.Scanner;
public class Main1 {

	public static void main(String[] args) {
		Scanner t=new Scanner(System.in);
		int n=t.nextInt(), cont=0;
		int p[] = new int[n];
		for(int i=0; i < n; i++) {
			p[i] = t.nextInt();
		}
		for(int i=1; i < n-1; i++) {
		if(p[i-1] < p[i] & p[i] > p[i+1]) {
			cont += i;
		}
		}
		System.out.println(cont);
	
	}

}

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

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

int main(){
    int N;
    cin >> N;
    vector<int> P(N);
    int cnt;
    for(int i=0; i<N; i++){
        cin >> P[i];
    }

    for(int i=1; i<N-1; i++){
        if(P[i-1] < P[i] || P[i+1] < P[i]){
            if(P[i-1] > P[i] || P[i+1] > P[i]){
                cnt++;
            }
        }
    }
    cout << cnt << endl;
}

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

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

Compiler output:
main.c: In function 'main':
main.c:18:16: error: expected expression before 'int'
   18 |   printf("%d", int c);
      |                ^~~
Language: C

#include <stdio.h>
#include <conio.h>

int main(void)
{
	int n, i, check = 0, x;
	int p[20];
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%d", &p[i]);
		x = 3 + i;
		gotoxy(x + i, 4);
	}
	
	for (i = 1; i < n - 1; i++){
		if (p[i] < p[i - 1] && p[i] > p[i + 1]){
			check++;
		}
		else if (p[i] > p[i - 1] && p[i] < p[i + 1]){
			check++;
		}
	}
	
	printf("\n%d\n", check);
	
	return (0);
}

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

//#include <bits/stdc++.h>
#include <stack>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	//入力
	long A[100001], B[100001], x[100001] = {};
	string S = {};
	char W[101] = {};
	bool f[101] = {};
	stack<pair<int, int>> dfs;
	long N = 0, K = 0, T = 0, M = 1000000000, ans = 0, l = 0, r = 0, sum = 0, a = 0, b = 0, c = 0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	//処理
	for (int i = 2; i < N; i++) {
		if (x[i - 2] > x[i - 1] && x[i - 1] > x[i])ans++;
		else if (x[i - 2] < x[i - 1] && x[i - 1] < x[i])ans++
	}
	//出力
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:70: error: expected ';' before '}' token
   22 |                 else if (x[i - 2] < x[i - 1] && x[i - 1] < x[i])ans++
      |                                                                      ^
      |                                                                      ;
   23 |         }
      |         ~
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int>p(n);
  for(int i=0;i<n;i++){
    cin>>p.at(i);
  }
  int answer=0;
  for(int i=0;i<n-2;i++){
    if(p.at(i)<p.at(i+1)<p.at(i+2)){
      answer++;
    }
    else if(p.at(i)>p.at(i+1)>p.at(i+2)){
      answer++;
    }
    else if(p.at(i)==p.at(i+1)>p.at(i+2)){
      amswer++;
    }
    else if(p.at(i)<p.at(i+1)==p.at(i+2)){
      answer++;
    }
  }
  cout<<answer<<endl;
}


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

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

int main() {
  int n;
  cin>>n;
  vector<int>p(n);
  for(int i=0;i<n;i++){
    cin>>p.at(i);
  }
  int answer=0;
  for(int i=0;i<n-2;i++){
    if(p.at(i)<p.at(i+1)<p.at(i+2)){
      answer++;
    }
    else if(p.at(i)>p.at(i+1)>p.at(i+2)){
      answer++;
    }
    else if(p.at(i)==p.at(i+1)>p.at(i+2)){
      amswer++
    }
    else if(p.at(i)<p.at(i+1)==p.at(i+2)){
      answer++
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'amswer' was not declared in this scope; did you mean 'answer'?
   20 |       amswer++
      |       ^~~~~~
      |       answer
a.cc:23:15: error: expected ';' before '}' token
   23 |       answer++
      |               ^
      |               ;
   24 |     }
      |     ~
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	vector<int> ps;

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

	int ans = 0;

	for(int i = 1; i < n - 1; i++) {
		int a = ps[i - 1];
		int b = ps[i];
		int c = ps[i + 1];
		if((a < b && b < c) || (a > b && b > c)) {
			ans += 1;
		}
	}

	printf("%d\n", ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int> ps;
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> ps;
      |                ^~~
a.cc:11:9: error: 'ps' was not declared in this scope
   11 |         ps.resize(i);
      |         ^~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |         ps.resize(i);
      |                   ^
Language: C

#include<stdio.h>
int main(){
  int n;
  int p;
  int ans=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",p[i]);
    if(i>2 && p[i-2]<p[i-1] && p[i-1]<p[i]){
       ans++;
    }
    else if(i>2 && p[i-2]>p[i-1] && p[i-1]>p[i]){
      ans++;
    }
    else{}
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: subscripted value is neither array nor pointer nor vector
    8 |     scanf("%d",p[i]);
      |                 ^
main.c:9:16: error: subscripted value is neither array nor pointer nor vector
    9 |     if(i>2 && p[i-2]<p[i-1] && p[i-1]<p[i]){
      |                ^
main.c:9:23: error: subscripted value is neither array nor pointer nor vector
    9 |     if(i>2 && p[i-2]<p[i-1] && p[i-1]<p[i]){
      |                       ^
main.c:9:33: error: subscripted value is neither array nor pointer nor vector
    9 |     if(i>2 && p[i-2]<p[i-1] && p[i-1]<p[i]){
      |                                 ^
main.c:9:40: error: subscripted value is neither array nor pointer nor vector
    9 |     if(i>2 && p[i-2]<p[i-1] && p[i-1]<p[i]){
      |                                        ^
main.c:12:21: error: subscripted value is neither array nor pointer nor vector
   12 |     else if(i>2 && p[i-2]>p[i-1] && p[i-1]>p[i]){
      |                     ^
main.c:12:28: error: subscripted value is neither array nor pointer nor vector
   12 |     else if(i>2 && p[i-2]>p[i-1] && p[i-1]>p[i]){
      |                            ^
main.c:12:38: error: subscripted value is neither array nor pointer nor vector
   12 |     else if(i>2 && p[i-2]>p[i-1] && p[i-1]>p[i]){
      |                                      ^
main.c:12:45: error: subscripted value is neither array nor pointer nor vector
   12 |     else if(i>2 && p[i-2]>p[i-1] && p[i-1]>p[i]){
      |                                             ^
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int>p(n);
  for(i=0;i<n;i++){
    cin>>p.at(i);
  }
  int answer=0;
  for(i=0;i<n-2;i++){
    if(p.at(i)<p.at(i+1)<p.at(i+2)){
      answer++
    }
    else if(p.at(i)>p.at(i+1)>p.at(i+2)){
      answer++
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<n;i++){
      |       ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=0;i<n-2;i++){
      |       ^
a.cc:14:15: error: expected ';' before '}' token
   14 |       answer++
      |               ^
      |               ;
   15 |     }
      |     ~          
a.cc:17:15: error: expected ';' before '}' token
   17 |       answer++
      |               ^
      |               ;
   18 |     }
      |     ~