Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _02_ABC081A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 0;
            int z = 0;
            bool check = false;
            string str;

            string s = Console.ReadLine();
            //string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            //int b = int.Parse(str[0]);  //数値で受け取りたい場合は変換する
            //int c = int.Parse(str[1]);

            for (int i = 0; i < s.Length; i++)
            {
                if (!check)
                {
                    if (s[i] == 'A')
                    {
                        a = i;
                        check = true;
                    }
                }
            }
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'Z')
                {
                    z = i;
                }
            }

            str = s.Substring(a, z - a + 1);

            Console.WriteLine(str.Length);
            Console.Read();


        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:49:6: error: expected ';' after class definition
   49 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void _02_ABC081A::Program::Main(int*)':
a.cc:16:13: error: 'string' was not declared in this scope
   16 |             string str;
      |             ^~~~~~
a.cc:18:20: error: expected ';' before 's'
   18 |             string s = Console.ReadLine();
      |                    ^
a.cc:23:33: error: 's' was not declared in this scope
   23 |             for (int i = 0; i < s.Length; i++)
      |                                 ^
a.cc:34:33: error: 's' was not declared in this scope
   34 |             for (int i = 0; i < s.Length; i++)
      |                                 ^
a.cc:42:13: error: 'str' was not declared in this scope; did you mean 'std'?
   42 |             str = s.Substring(a, z - a + 1);
      |             ^~~
      |             std
a.cc:42:19: error: 's' was not declared in this scope
   42 |             str = s.Substring(a, z - a + 1);
      |                   ^
a.cc:44:13: error: 'Console' was not declared in this scope
   44 |             Console.WriteLine(str.Length);
      |             ^~~~~~~