Language: C++

# include <iostream>
#include <string>
using namepsace std;
int main(void){
 string s;
 cin >> s >> endl;
  int start end;
  for (int i = 0; i<s.length();i++){
    if (s[i] == 'A') start = i; break;
  }
  for (int i = s.length-1; i>=start;i--){
    if (s[i] == 'Z') start = i; break;
  }
  cout << (long long)end -start + 1 << endl;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namepsace'
    3 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
    5 |  string s;
      |  ^~~~~~
a.cc:5:2: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |  cin >> s >> endl;
      |  ^~~
      |  std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:9: error: 's' was not declared in this scope
    6 |  cin >> s >> endl;
      |         ^
a.cc:6:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |  cin >> s >> endl;
      |              ^~~~
      |              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:7:13: error: expected initializer before 'end'
    7 |   int start end;
      |             ^~~
a.cc:9:22: error: 'start' was not declared in this scope
    9 |     if (s[i] == 'A') start = i; break;
      |                      ^~~~~
a.cc:11:31: error: 'start' was not declared in this scope
   11 |   for (int i = s.length-1; i>=start;i--){
      |                               ^~~~~
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout << (long long)end -start + 1 << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:22: error: 'end' was not declared in this scope; did you mean 'std::end'?
   14 |   cout << (long long)end -start + 1 << endl;
      |                      ^~~
      |                      std::end
In file included from /usr/include/c++/14/string:53:
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:14:27: error: 'start' was not declared in this scope
   14 |   cout << (long long)end -start + 1 << endl;
      |                           ^~~~~