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

import java.util.*;
public class Main{

public static void main(String[] args){
  Scanner inp = new Scanner(System.in);
  String u = input.next();
  int aPos = -1;
  int zPos = u.length;
  for(int i = u.length - 1; i > 0; i--){
    String chr = u.substring(i - 1,i);
    if(chr.equals("A"))
      aPos = i;
     
  }
  for(int j = aPos; j < u.length - 1; j++){
    String chr2 = u.substring(j,j+ 1);
    if(chr2.equals("Z"))
      zPos = j;
  }
  System.out.println(zPos - aPos + 1); 
}
}


Compiler output:
Main.java:6: error: cannot find symbol
  String u = input.next();
             ^
  symbol:   variable input
  location: class Main
Main.java:8: error: cannot find symbol
  int zPos = u.length;
              ^
  symbol:   variable length
  location: variable u of type String
Main.java:9: error: cannot find symbol
  for(int i = u.length - 1; i > 0; i--){
               ^
  symbol:   variable length
  location: variable u of type String
Main.java:15: error: cannot find symbol
  for(int j = aPos; j < u.length - 1; j++){
                         ^
  symbol:   variable length
  location: variable u of type String
4 errors
Language: Java

import java.util.*;
public class Main{

public static void main(String[] args){
  Scanner inp = new Scanner(System.in);
  String u = input.next();
  int aPos = -1;
  int zPos = u.length;
  for(int i = u.length - 1; i > 0; i--){
    String chr = u.substring(i - 1,i);
    if(chr.equals("A"))
      aPos = i;
     
  }
  for(int j = aPos; j < u.length - 1){
    String chr2 = u.substring(j,j+ 1);
    if(chr2.equals("Z"))
      zPos = j;
  }
  System.out.println(zPos - aPos + 1); 
}
}


Compiler output:
Main.java:15: error: ';' expected
  for(int j = aPos; j < u.length - 1){
                                    ^
1 error
Language: Java

import java.util.*
public class Main{

public static void main(String[] args){
  Scanner inp = new Scanner(System.in);
  String u = input.next();
  int aPos = -1;
  int zPos = u.length;
  for(int i = u.length - 1; i > 0; i--){
    String chr = u.substring(i - 1,i);
    if(chr.equals("A"))
      aPos = i;
     
  }
  for(int j = aPos; j < u.length - 1){
    String chr2 = u.substring(j,j+ 1);
    if(chr2.equals("Z"))
      zPos = j;
  }
  System.out.println(zPos - aPos + 1); 
}
}


Compiler output:
Main.java:1: error: ';' expected
import java.util.*
                  ^
Main.java:15: error: ';' expected
  for(int j = aPos; j < u.length - 1){
                                    ^
2 errors
Language: Java

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

public class Exp { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		int index = str.indexOf('A');
		String ans = "";
		for (int i = index; i < str.length(); i++ )
		{
			if(str.charAt(i)=='Z')
			{
				System.out.print(str.charAt(i));
				break;
			}
			else
				System.out.print(str.charAt(i));

		}
		

	}
}

Compiler output:
Main.java:4: error: class Exp is public, should be declared in a file named Exp.java
public class Exp { // "Main" should be used for most online judges
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();

        int maxL = 0;
        int start;

        for (int i = 0; i < s.length(); i++) {
            
            int L = 0;

            if (s.charAt(i) == 'A') {
                start = i;
            }
            
            if (s.charAt(i) == 'Z') {
                L = i - start;
            }
            
            if (L >= maxL) {
                maxL = L;
            }

        }
        
        System.out.println(maxL);


    }


}

Compiler output:
Main.java:22: error: variable start might not have been initialized
                L = i - start;
                        ^
1 error
Language: C++

#include <string>
using namespace std;

int main(){
	string s;
	cin >> s;
	int l = -1, r = -1;
	for(int i = 0; i < s.size(); i++)
		if(s[i] == 'A'){
			l = i;
			break;
		}
	for(int i = s.size()-1; i >= 0; i--)
		if(s[i] == 'Z'){
			r = i;
			break;
		}
	if(l == -1 || r == -1 || r < l)
		cout << 0 << endl;
	else
		cout << r - l + 1 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> s;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:19:17: error: 'cout' was not declared in this scope
   19 |                 cout << 0 << endl;
      |                 ^~~~
a.cc:19:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:30: error: 'endl' was not declared in this scope
   19 |                 cout << 0 << endl;
      |                              ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:21:17: error: 'cout' was not declared in this scope
   21 |                 cout << r - l + 1 << endl;
      |                 ^~~~
a.cc:21:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:38: error: 'endl' was not declared in this scope
   21 |                 cout << r - l + 1 << endl;
      |                                      ^~~~
a.cc:21:38: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <iomanip>


int main()
{
	std::string s;

	std::cin >> s;

	long long start = -1;
	long long ans = 0;
	for (size_t i = 0; i < s.length(); i++) {
		if (s[i] == 'A') {
			start = i;
		} else if (start != -1 && s[i] == 'Z') {
			ans = std::max(ans, i - start + 1);
		} else {
			start = -1;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:39: error: no matching function for call to 'max(long long int&, long long unsigned int)'
   28 |                         ans = std::max(ans, i - start + 1);
      |                               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:28:39: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   28 |                         ans = std::max(ans, i - start + 1);
      |                               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:28:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |                         ans = std::max(ans, i - start + 1);
      |                               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    char ch[200010];
    gets(ch);
    int len=strlen(ch);
    int ansa=0,ansb;
    for(int i=0;i<len;i++){
        if(ch[i]=='A'){
            if(ansa) continue;
            ansa=i;
        }
        if(!ansa) continue;
        if(ch[i]=='Z'){
            ansb=i;
        }
    }
    cout<<ansb-ansa+1<<endl;
}


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

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

int main(){
    char s[200002];
    int s;
    int i,j,k,max=0,count=0;
    while((c=getchar())!='\n'){
        s[i]=c;
        i++;
    }
    for(j=0;j=i;j++){
        if(s[i]='A'){
            k=i;
            while(s[k]!='Z'){
                count++;
                k++;
            }
        }
        if(max<count){
            max=count;        
        }
    }
    printf("%d\n",max);
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: conflicting types for 's'; have 'int'
    6 |     int s;
      |         ^
main.c:5:10: note: previous declaration of 's' with type 'char[200002]'
    5 |     char s[200002];
      |          ^
main.c:8:12: error: 'c' undeclared (first use in this function)
    8 |     while((c=getchar())!='\n'){
      |            ^
main.c:8:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	char AZ[] = { "A", "Z" };
	int x, y;
	cin >> s;
	for (int i = 0; i < s.size(); i++){
		if (s[i] == AZ[0]){ x = i; }
	}
	for (int j = 0; j < s.size(); j++){
		if (s[j] == AZ[1]){ y = j; }
	}
	cout << y - x << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:32: error: too many initializers for 'char []'
    6 |         char AZ[] = { "A", "Z" };
      |                                ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.IOException;

public class Main{
	public static void main(String[] args) throws IOException{
 		BufferedReader br = new BufferedReader(
 			new InputStream(System.in));
 		String s = br.readLine();
 		int idxA =0;
 		for(int i=0; i<s.length(); i++){
 			if(s.charAt(i)=='A'){
 				idxA = i;
 				break;
 			}
 		}
 		int idxZ = s.length()-1;
 		for(int j = s.length()-1; j>=0; j--){
 			if(s.charAt(j) =='Z'){
 				idxZ = j;
 				break;
 			}
 		}
 		System.out.println(idxZ - idxA + 1);
 	}
} 

Compiler output:
Main.java:8: error: InputStream is abstract; cannot be instantiated
 			new InputStream(System.in));
 			^
1 error
Language: Java


import java.util.Scanner;

public class B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		char A[] = new char[200000];
		A = sc.next().toCharArray();
		int max=1;
		int count=0;
		boolean flag=false;
		for(int i=0;i<A.length;i++){
			if(A[i]=='A'){
				flag=true;
			}
			if(A[i]=='Z' && flag){
				count++;
				if(max<count)
				max=count;
			}
			else if(flag){
				count++;
			}
		}
		System.out.println(max);
	}
}


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

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
string a;
int A,s,e;
int main(void){
	A=0;
	cin>>a;
	for(int i=0;i<a.size();i++){
	if(a[i]=='A'){
		s=i;
		break;
	
	}	
	for(int i=0;i<a.size();i++){
	if(a[i]=='Z'){
		e=i;
	
	}	
}


	cout<<e-s<<endl;
return 0;
}

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

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
string a;
int A,s,e;
int main(void){
	A=0;
	cin>>a;
	for(int i=0;i<a.size();i++){
	if(a[i]=='A'){
		s=i;
		for(i=a.size();i>0();i--){
		if(a[i]=='Z'){
			e=i;
			break;
		
			}
		}	
	}
}

	cout<<e-s<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:35: error: expression cannot be used as a function
   13 |                 for(i=a.size();i>0();i--){
      |                                  ~^~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
string a;
int A,s,e;
int main(void){
	A=0;
	cin>>a;
	for(int i=0;i<a.size();i++){
	if(a[i]=='A'){
		s=i;
		for(i=a.size();i>0();i--){
		if(a[i]=='Z'){
			e=i;
			break;
		
			}
		}	
	}


	cout<<e-s<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:35: error: expression cannot be used as a function
   13 |                 for(i=a.size();i>0();i--){
      |                                  ~^~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:7:15: note: to match this '{'
    7 | int main(void){
      |               ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
		
		string s;
		int t,u;
		
		cin>>s;
		for(int i=0;i<s.size();i++){
			
			if(s[i]=="A")i=t;
				
			if(s[i]=="Z")i=u;
		}
		cout<<u-t;
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |                         if(s[i]=="A")i=t;
a.cc:14:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |                         if(s[i]=="Z")i=u;
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>

typedef long long ll;
using namespace std;
const ll INF = 1000000000000000000ll;
const ll MOD = 1000000007ll;

const double EPS = 1e-8;

int main()
{
	char S[2000000];

	cin >> S;

	int a=0,z=0;
	bool af=0;

	for(int i=0;i<strlen(S);i++){
		if(S[i]=='A'&&af==0){ a=i;af=1;};
		if(S[i]=='Z') z=i;
	}

	cout << z-a+1<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: 'strlen' was not declared in this scope
   23 |         for(int i=0;i<strlen(S);i++){
      |                       ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | #include <string>
Language: Java

import java.util.Scanner;

public class B_53{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int s = -1;
    for(int i = 0; i < str.length(); i++){
      if(str.charAt(i) == 'A'){
        s = i;
        break;
      }
    }
 
    int t = -1;
    for(int i = str.length() - 1; i >= 0; i--){
      if(str.charAt(i) == 'Z'){
        t = i;
        break;
      }
    }
 
    System.out.println((t - s) + 1);
  }
}

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

import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static String line=sc.next();
	private static int start,end;
	public static void main(String[] args){
		char[] c=line.toCharArray();
		for(int i=0;i<=c.length-1;i++){
			if(c[i]=='A') start=i;
		}
		for(int i=c.length-1;i>=0;i--){
			if(c[i]=='Z') end=i;
		}
		int ans=end-start+1;
		System.out.println(ans);
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    string s;
    cin >> s;
    rep(i, n)if(s[i] == 'A')break;
    per(j, n)if(s[j] == 'Z')break;
    pri(j - i + 1);

/*/

//*/ break;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:12: error: 'n' was not declared in this scope
   56 |     rep(i, n)if(s[i] == 'A')break;
      |            ^
a.cc:26:33: note: in definition of macro 'rep'
   26 | #define rep(i, n) for(i = 0;i < n;++i)
      |                                 ^
a.cc:57:12: error: 'n' was not declared in this scope
   57 |     per(j, n)if(s[j] == 'Z')break;
      |            ^
a.cc:28:27: note: in definition of macro 'per'
   28 | #define per(i, n) for(i = n - 1;i > -1;--i)
      |                           ^
Language: C++

# coding: utf-8

words=input().rstrip()

a=words.find("A")
z=words.rfind("Z")

print(z-a+1)


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:3:1: error: 'words' does not name a type
    3 | words=input().rstrip()
      | ^~~~~
Language: C

#include <string.h>
#include<stdio.h>
const int MAX_LEN = 200000;
int main()
{
	int x;
	char s[MAX_LEN];
	printf("Input string s: ");
	fgets(s, MAX_LEN, stdin);
	int len = strlen(s);
	int index = 0, indexA;
	strcpy(s,  strupr(s));
	
	while(index < len)
	{
		if (s[index] == 'A')	
		break;
		printf("%c,", s[index])	;
		index++;
	}
	
    printf("String input: %s\n",s);
 
	indexA = index;
	index = len - 1;
	while(index > 0)
	{
		if (s[index] == 'Z')
			break;
		index--;
	}
	
	if(indexA > index || index == 0)
    	printf("String input is error!: %d, index: %d", indexA, index);
    else 
    	printf("Result: %d", (index - indexA + 1));
	return 0;

}



Compiler output:
main.c: In function 'main':
main.c:12:20: error: implicit declaration of function 'strupr'; did you mean 'strstr'? [-Wimplicit-function-declaration]
   12 |         strcpy(s,  strupr(s));
      |                    ^~~~~~
      |                    strstr
main.c:12:20: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
   12 |         strcpy(s,  strupr(s));
      |                    ^~~~~~~~~
      |                    |
      |                    int
In file included from main.c:1:
/usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'int'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main() {

string S;
cin >> S;
int a_index = z_index = -1, S_length = S.size();

for (int i = 0; i < S_length; i++) {

if ( S[i] == "A" && a_index != -1) a_index = i;
if ( S[S_length - i - 1] == "Z" && z_index != -1 ) z_index = S_length - i - 1;

if ( a_index != -1 && z_index != -1) break;
}

cout << z_index - a_index + 1;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'z_index' was not declared in this scope; did you mean 'a_index'?
    9 | int a_index = z_index = -1, S_length = S.size();
      |               ^~~~~~~
      |               a_index
a.cc:11:21: error: 'S_length' was not declared in this scope
   11 | for (int i = 0; i < S_length; i++) {
      |                     ^~~~~~~~
a.cc:13:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if ( S[i] == "A" && a_index != -1) a_index = i;
Language: C++

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

int main() {
	// your code goes here
	string x;
	cin >> x;
	int ans = x.find_last_of("Z") - x.find_first_of("A")+1;
	cout << ans;
	return 0;

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

#include<bits/stdc++.h>

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define vi vector<int>
typedef long long ll;

using namespace std;


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.precision(0); 
	string s;
	cin >> s;
	int a = 0 , int z = sz(s) - 1;
	while(s[a] != 'A')++a;
	while(s[z] != 'Z')--z;
	die(z - a + 1);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: expected unqualified-id before 'int'
   33 |         int a = 0 , int z = sz(s) - 1;
      |                     ^~~
a.cc:35:17: error: 'z' was not declared in this scope
   35 |         while(s[z] != 'Z')--z;
      |                 ^
a.cc:36:13: error: 'z' was not declared in this scope
   36 |         die(z - a + 1);
      |             ^
a.cc:19:30: note: in definition of macro 'die'
   19 | #define die(s) {std::cout << s << nl;}
      |                              ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int a = 0;
    int b = 0;
    for(int i = 0; i < s.length(); i++) {
      if(s.charAt(i) == 'A') {
        a = i;
        break;
      }
    }
    for(int i = s.length() - 1; i >= 0; i--) {
      if(s.charAt(i) == 'Z') {
        b = i;
        break;
      }
    }
    return b - a + 1;
  }
}

Compiler output:
Main.java:21: error: incompatible types: unexpected return value
    return b - a + 1;
                 ^
1 error
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>


#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;


template <typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v){
    if(!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}

template <typename T1, typename T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &p) {
    out << "[" << p.first << ", " << p.second << "]";
    return out;
}
//---------


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //CLion Standard Input
    //--------------------------------------------------------------------------
//    ifstream in("/Users/ryo/Dropbox/competition/CompetitiveProgramming/in.txt");
//    cin.rdbuf(in.rdbuf());
    //--------------------------------------------------------------------------

    string s;
    cin >> s;

    int left = 0;
    while(s[left] != 'A'){
        left++;
    }

    int right = s.size();
    while(s[right] != 'Z'){
        right--;
    }


    cout << right - left + 1 << endl;

}

Compiler output:
a.cc: In function 'std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)':
a.cc:26:44: error: 'ostream_iterator' is not a member of 'std'
   26 |         std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
      |                                            ^~~~~~~~~~~~~~~~
a.cc:14:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
   13 | #include <fstream>
  +++ |+#include <iterator>
   14 | 
a.cc:26:62: error: expected primary-expression before '>' token
   26 |         std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
      |                                                              ^
Language: Java

package AtCoder;
import java.io.*;


public class Main  {
	  
      public static void main(String[]args){
    	  BufferedReader reader = new BufferedReader (new InputStreamReader (System.in));
    	  String line;
    	  String [] array;
    	  array = line.split("");
    	
    	  int startNumber=0;
    	  int endNumber=0;
    	  int i;
    	  for (i=0; i<array.length; i++){
    		  if (array[i].equals("A")){
    			  startNumber = i;
    			  break;			  
    		  }
    	  }
    	  for (int j=i; j<array.length; j++){
    		  if (array[j].equals("Z")){
    			  endNumber = j;
    		  }
    	  }
    	 
    	  
    	  System.out.println(endNumber - startNumber + 1);
     	  
    		  
      }
}


Compiler output:
Main.java:11: error: variable line might not have been initialized
    	  array = line.split("");
    	          ^
1 error
Language: C

#include <stdio.h>

int main(void)
{
	char s[200000];
	long a,i = 0;
	scanf("%s",s);
	while(1){
		if(text[i] == "A"){
			a = i;
			i = 200000;
			break;
		}
		else{i++;}
	}
	while(1){
		if(text[i] == "Z"){
			a = i - a + 1;
			break;
		}
		else{i--;}+
	}
	printf("%d",a)
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:20: error: 'text' undeclared (first use in this function)
    9 |                 if(text[i] == "A"){
      |                    ^~~~
main.c:9:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:9: error: expected expression before '}' token
   22 |         }
      |         ^
main.c:23:23: error: expected ';' before 'return'
   23 |         printf("%d",a)
      |                       ^
      |                       ;
   24 |         return 0;
      |         ~~~~~~
Language: C

#include <stdio.h>
int main(void){
    char s[200000];
    scanf("%s",s);
    int i,j,k,l;
    for(i=0;i<200000;i++){
        if(s[i]=='A'){
            j=i;
            break;
        }
    }
    for(k=j;k<2000000;k++){
        if(s[k]=='Z'){
            l=k;
        }else if(s[k]=='\n'){
break;
    }
    int length;
    length=l-j+1;
    printf("%d",length);
    return 0;
}

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

#include <stdio.h>
int main(void){
    char s[200000];
    scanf("%199999s",s);
    int i,j,k,l;
    for(i=0;i<200000;i++){
        if(s[i]=='A'){
            j=i;
            break;
        }
    }
    for(k=j;k<2000000;k++){
        if(s[k]=='Z'){
            l=k;
        }
    }
    int length;
    length=l-j+1;
    prinf(%d,length);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   19 |     prinf(%d,length);
      |     ^~~~~
      |     printf
main.c:19:11: error: expected expression before '%' token
   19 |     prinf(%d,length);
      |           ^
Language: C

#include <stdio.h>
int main(void){
    char s[200000];
    scanf("%199999s",s);
    int i,j,k,l;
    for(i=0;i<200000;i++){
        if(s[i]=="A"){
            j=i;
            break;
        }
    }
    for(k=j;k<2000000;k++){
        if(s[k]=="Z"){
            l=k;
        }
    }
    int length;
    length=l-j+1;
    prinf(%d,length);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:16: warning: comparison between pointer and integer
    7 |         if(s[i]=="A"){
      |                ^~
main.c:13:16: warning: comparison between pointer and integer
   13 |         if(s[k]=="Z"){
      |                ^~
main.c:19:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   19 |     prinf(%d,length);
      |     ^~~~~
      |     printf
main.c:19:11: error: expected expression before '%' token
   19 |     prinf(%d,length);
      |           ^
Language: C

#include <stdio.h>
int main(void){
    char s[200000];
    scanf("%199999s",s);
    int i,j,k,l;
    for(i=0;i<200000;i++){
        if(s[i]==A){
            j=i;
            break;
        }
    }
    for(k=j;k<2000000;k++){
        if(s[k]==Z){
            l=k;
        }
    }
    int length;
    length=l-j+1;
    prinf(%d,length);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: 'A' undeclared (first use in this function)
    7 |         if(s[i]==A){
      |                  ^
main.c:7:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:18: error: 'Z' undeclared (first use in this function)
   13 |         if(s[k]==Z){
      |                  ^
main.c:19:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   19 |     prinf(%d,length);
      |     ^~~~~
      |     printf
main.c:19:11: error: expected expression before '%' token
   19 |     prinf(%d,length);
      |           ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int s;
	cin >> s;
	int a = s.find("a");
	int z = s.rfind("z");
	cout << z - a + 1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: request for member 'find' in 's', which is of non-class type 'int'
    9 |         int a = s.find("a");
      |                   ^~~~
a.cc:10:19: error: request for member 'rfind' in 's', which is of non-class type 'int'
   10 |         int z = s.rfind("z");
      |                   ^~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int s;
	cin >> s;
	int a = s.find();
	int z = s.rfind();
	cout << z - a + 1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: request for member 'find' in 's', which is of non-class type 'int'
    9 |         int a = s.find();
      |                   ^~~~
a.cc:10:19: error: request for member 'rfind' in 's', which is of non-class type 'int'
   10 |         int z = s.rfind();
      |                   ^~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int s;
	cin >> s;
	int a = str.find();
	int z = str.rfind();
	cout << z - a + 1 << endl;
	return 0;
}

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

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

int main()
{
	string s;
	cin >> s;
	int a = -1, z;
	for (int i = 0; i < s.size(); i++) {
		if (a == -1 && s[i] == "A") {
			a = i;
		}
		if (s[i] == "Z") {
			z = i;
		}
	}
	cout << (z - a + 1) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 if (a == -1 && s[i] == "A") {
a.cc:13:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                 if (s[i] == "Z") {
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
	char s[200100]={"\0"};
	scanf("%s",s);
	int loop1;
	int st=-1;
	int go=-1;
	for(loop1=0;loop1<200001;loop1++){
		if(st==-1){
			if(s[loop1]=="A"){
				st=loop1;
			}
		}
		if(st!=-1){
			if(s[loop1]=="Z"){
				go==loop1;
			}
		}
	}
		int ans=go-st;
		print("%d\n",ans+1);

		return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:36: warning: comparison between pointer and integer
   11 |                         if(s[loop1]=="A"){
      |                                    ^~
main.c:16:36: warning: comparison between pointer and integer
   16 |                         if(s[loop1]=="Z"){
      |                                    ^~
main.c:22:17: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   22 |                 print("%d\n",ans+1);
      |                 ^~~~~
      |                 printf
Language: C++

# -*- coding: utf-8 -*-
s = input()
l = 1000000
r = 0
for i, c in enumerate(s):
    if c == "A":
        l = min(l, i)
    if c == "Z":
        r = i
print(r - l + 1)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:2:1: error: 's' does not name a type
    2 | s = input()
      | ^
Language: C++

s = input()
l = 1000000
r = 0
for i, c in enumerate(s):
    if c == "A":
        l = min(l, i)
    if c == "Z":
        r = i
print(r - l + 1)

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

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    string s;
    cin >> s;
    int l, r;
    REP(i,s.length()) if (s[i] == 'A') l = i, break;
    REP(i,s.length()) if (s[i] == 'Z') r = i;
    cout << r-l+1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:47: error: expected primary-expression before 'break'
   31 |     REP(i,s.length()) if (s[i] == 'A') l = i, break;
      |                                               ^~~~~
Language: C

#include <stdio.h>
#include <string.h>

int main(){

  char str[200010];
  int len,i,ans=0,flag=0;

  scanf("%s",str);

  len=strlen(str);

  for(i=0;i<len;i++){
    if(str[i]=='A' && flag==0){
      flag=1;
    }
    if(flag==1){
      count++;
      if(str[i]=='Z'){
        ans=count;
      }
    }
  }
  printf("%d\n",ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:7: error: 'count' undeclared (first use in this function)
   18 |       count++;
      |       ^~~~~
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>

int main(void)
{
	int a,b=0,c=0,ans;
	char s[200000];
	scanf("%s",&s);
	for(a=0;a<strlen(s);a++){
		if(s[a]=='A'&&c==0){
			c=1;
		}
		if(c==1){
			b++;
			if(s[a]=='Z'){
				ans=b;
			}
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'strlen' was not declared in this scope
    8 |         for(a=0;a<strlen(s);a++){
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	long memo1 = 114514810;
	int memo2 = 0;
	int ans = 0;
	string s;
	cin >> s;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'A') memo1 = min(memo1, i);
	}
	for (int j = 0; j < s.length(); j++) {
		if (s[j] == 'Z') memo2 = max(memo2, j);
	}
	ans = memo2 - memo1 + 1;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:45: error: no matching function for call to 'min(long int&, int&)'
   13 |                 if (s[i] == 'A') memo1 = min(memo1, i);
      |                                          ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:13:45: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   13 |                 if (s[i] == 'A') memo1 = min(memo1, i);
      |                                          ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:13:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   13 |                 if (s[i] == 'A') memo1 = min(memo1, i);
      |                                          ~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	int memo1 = 0;
	int memo2 = 0;
	int ans = 0;
	string s;
	cin >> s;
	for (int i = 0; i < s.length; i++) {
		if (s[i] == 'A') memo1 = max(memo1, i);
	}
	for (int j = 0; j < s.length; j++) {
		if (s[j] == 'Z') memo2 = max(memo2, j);
	}
	ans = memo2 - memo1 + 1;
	cout << ans << endl;
	return 0;
}

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


int main() {
	
	string A;

	cin >> A;

	int a,z;

	for (int i = 0; i <= A.size(); i++) {
		if (A[i] == 'A') {
			a = i;
		}
		if (A[i] == 'Z') {
			z = i;
		}
	}

	cout << z - a+1 << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string A;
      |         ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> A;
      |         ^~~
a.cc:6:16: error: 'A' was not declared in this scope
    6 |         cin >> A;
      |                ^
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << z - a+1 << endl;
      |         ^~~~
a.cc:19:28: error: 'endl' was not declared in this scope
   19 |         cout << z - a+1 << endl;
      |                            ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
  char s[200000];
  scanf("%s",s);
  int i;
  while(s[i]!=A)
  {
    i++;
    if(i==strlen(s))
    {printf("0"):
    return 0;}
  }
  int t=i;
  while(s[t]!=Z)
  {
    t++;
    if(t==strlen(s)&&s[t]!=Z)
    {printf("0");
    return 0;}
  }
  printf("%d",t-i+1);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'A' was not declared in this scope
    8 |   while(s[i]!=A)
      |               ^
a.cc:12:17: error: expected ';' before ':' token
   12 |     {printf("0"):
      |                 ^
      |                 ;
a.cc:16:15: error: 'Z' was not declared in this scope
   16 |   while(s[t]!=Z)
      |               ^
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String s=sc.next();
String rev=new StringBuffer(s).reverse().toString();
int l=s.length();
int ctr=0;
int fA=0;
int fZ=0;
while(fA==0){
if(s.charAt(ctr)=='A'){fA=ctr;ctr=0;break;}
ctr++;
}
while(fZ==0){
if(rev==0){fZ=ctr;break;}
ctr++;
}
System.out.println(l-fZ-fA);
}
}

Compiler output:
Main.java:16: error: bad operand types for binary operator '=='
if(rev==0){fZ=ctr;break;}
      ^
  first type:  String
  second type: int
1 error
Language: C++

#include<stdio.h>
#include<string.h>

int main(){
 char ch[200000];
 gets(ch);
 unsigned a, b;
 for(a = 0; ch[a] != 'A'; a++);
 for(b = strlen(ch); ch[b] != 'Z'; b--);
 printf("%d\n", b - a + 1);
}

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

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

int main() {
	int loop = 0;
	char s[200001];
	int len;
	int front, back;
	front = back = 0;

	cin >> s;
	len = strlen(s);
	while (s[loop++] != 'A')front++;
	loop = len + 1;
	while (s[loop--] != 'Z')back++;

	cout << len - front - back + 2 << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'strlen' was not declared in this scope
   13 |         len = strlen(s);
      |               ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <map>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <set>
#include <queue>
#include <list>

using namespace std;
char s[200010];
int main()
{
    int n;
    gets(s);
    int len=strlen(s);
    int a=0,b=len-1;
    for(int i=0;i<len;++i)
    {
        if(s[i]=='A')
        {
            a=i;
            break;
        }
    }
    for(int i=len-1;i>=0;--i)
    {
        if(s[i]=='Z')
        {
            b=i;
            break;
        }
    }
    printf("%d",b-a+1);
    return 0;
}


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

#include<bits/stdc++.h>
#define F first
#define S second
#define INF (1<<30)
#define LINF (1LL<<60)
using namespace std;
typedef pair<long long,long long> P;
long long a,b,c,d;
string s,s2,s3;
long long  sum=0,ans=0,pos=0;
long long n,m,h,w;
main(){
  cin>>s;
  n=s.size();
  a=0;
  b=0;
  for(int i=0;i<n;i++){
    if(s[i]=='A'){
      a=i;
      break;
    }
  }


Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:12:7: note: to match this '{'
   12 | main(){
      |       ^
Language: C++

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

int main(void)
{
    long long x;
    cin >> x;
    cout << (2*x + 10)/11; << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: expected primary-expression before '<<' token
    8 |     cout << (2*x + 10)/11; << endl;
      |                            ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pi> vpi;
typedef vector<vi> vii;
typedef map<int, int> mp;
typedef multiset<int> mset;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
typedef vector<int64> vi64;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define form(i,j,k,l) for(int i=j;i<int(k);i+=l)
#define rform(i,j,k,l) for(int i=int(j);i>int(l);i-=l)
#define rep(i, j) for(int i=0;i<int(j);i++)
#define rrep(i, j) for(int i=int(j);i>=0;i--)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define forc(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert( B <= A && A <= C)
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define INF (int)1e9
#define INF64 (int64)1e18
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define read(type) readInt<type>()
#define F first
#define S  second
const double pie = acos(-1.0);
template <typename T>
T Max(T x, T y)
{
  return (x > y) ? x : y;
}
template <typename T>
T Min(T x, T y)
{
  return (x > y) ? y : x;
}
int gcd(int n1, int n2)
{
  if (n2 != 0) return gcd(n2, n1 % n2);
  else return n1;
}
#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#else
#define trace(...)
#endif
clock_t time_p = clock();
void rtime() { time_p = clock() - time_p; cerr << "Time Taken : " << (float)1000 * (time_p) / CLOCKS_PER_SEC << "\n";}
int main()
{ fast;
  long long int x;
  cin >> x;
  long long int r = 11;
  long long int ans = (long long int)2 * (x / r);
  long long int res = x % r;
  if(res==0)
  {  cout<<ans;
     endl;
  }
 if (res <= 6)
    ans++;
  else
    ans = ans + 2;
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:10: error: statement cannot resolve address of overloaded function
   76 |      endl;
      |          ^