Language: C++

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

int main(){
    int a,b,c;  //文字数を宣言
    string N; //文字列を宣言
    cin >> N; //文字列を代入
    for(int i=0; i < N.size() ;++i){　//N文字目までループ
       if(N.at(i) == "A"){　　　//Aが出たときの文字数
        a=N.size(i);　　　　　
       }
       else if(N.at(i)=="Z"){　　　//Zが出たときの文字数
        b =N.size(i);
           for(int j=N.size(i);j<N.size(N);++j){
              if(N.at(j)=="Z"){
                  b=N.size(i);
              else{
                  break;
              }
              } 
           }
        }

       c=b-a; 
    }
    cout << c <<endl;
}

Compiler output:
a.cc:8:37: error: extended character 　 is not valid in an identifier
    8 |     for(int i=0; i < N.size() ;++i){　//N文字目までループ
      |                                     ^
a.cc:9:27: error: extended character 　 is not valid in an identifier
    9 |        if(N.at(i) == "A"){　　　//Aが出たときの文字数
      |                           ^
a.cc:9:27: error: extended character 　 is not valid in an identifier
a.cc:9:27: error: extended character 　 is not valid in an identifier
a.cc:10:21: error: extended character 　 is not valid in an identifier
   10 |         a=N.size(i);　　　　　
      |                     ^
a.cc:10:21: error: extended character 　 is not valid in an identifier
a.cc:10:21: error: extended character 　 is not valid in an identifier
a.cc:10:21: error: extended character 　 is not valid in an identifier
a.cc:10:21: error: extended character 　 is not valid in an identifier
a.cc:12:30: error: extended character 　 is not valid in an identifier
   12 |        else if(N.at(i)=="Z"){　　　//Zが出たときの文字数
      |                              ^
a.cc:12:30: error: extended character 　 is not valid in an identifier
a.cc:12:30: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:37: error: '\U00003000' was not declared in this scope
    8 |     for(int i=0; i < N.size() ;++i){　//N文字目までループ
      |                                     ^~
a.cc:12:8: error: 'else' without a previous 'if'
   12 |        else if(N.at(i)=="Z"){　　　//Zが出たときの文字数
      |        ^~~~
a.cc:12:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |        else if(N.at(i)=="Z"){　　　//Zが出たときの文字数
      |                ~~~~~~~^~~~~
a.cc:12:30: error: '\U00003000\U00003000\U00003000' was not declared in this scope
   12 |        else if(N.at(i)=="Z"){　　　//Zが出たときの文字数
      |                              ^~~~~~
a.cc:14:28: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
   14 |            for(int j=N.size(i);j<N.size(N);++j){
      |                      ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:14:40: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(std::string&)'
   14 |            for(int j=N.size(i);j<N.size(N);++j){
      |                                  ~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:15:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |               if(N.at(j)=="Z"){
      |                  ~~~~~~~^~~~~
a.cc:16:27: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
   16 |                   b=N.size(i);
      |                     ~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:17:15: error: expected '}' before 'else'
   17 |               else{
      |               ^~~~
a.cc:15:31: note: to match this '{'
   15 |               if(N.at(j)=="Z"){
      |                               ^
a.cc: At global scope:
a.cc:26:5: error: 'cout' does not name a type
   26 |     cout << c <<endl;
      |     ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^