Language: C++

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

namespace yukicode001
{
    class Program
    {
        static void Main()
        {
            Program pg = new Program();
            string word = Console.ReadLine();

            int a = word
                .Select((content, index) => new
                {
                    Index = index,
                    Content = content
                })
                .Where(x => x.Content == 'a')
                .Select(x => x.Index)
                .First();

            int z = word
                .Select((content, index) => new
                {
                    Index = index,
                    Content = content
                })
                .Where(x => x.Content == 'z')
                .Select(x => x.Index)
                .First();

            var new_word = word.Skip(a).Take(z - a + 1).Count();

            Console.WriteLine(new_word);
            //Console.WriteLine(z);

           

        }
    }
}


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:44:6: error: expected ';' after class definition
   44 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void yukicode001::Program::Main()':
a.cc:13:26: error: conversion from 'yukicode001::Program*' to non-scalar type 'yukicode001::Program' requested
   13 |             Program pg = new Program();
      |                          ^~~~~~~~~~~~~
a.cc:14:13: error: 'string' was not declared in this scope
   14 |             string word = Console.ReadLine();
      |             ^~~~~~
a.cc:16:21: error: 'word' was not declared in this scope
   16 |             int a = word
      |                     ^~~~
a.cc:17:26: error: 'content' was not declared in this scope; did you mean 'const'?
   17 |                 .Select((content, index) => new
      |                          ^~~~~~~
      |                          const
a.cc:17:35: error: 'index' was not declared in this scope
   17 |                 .Select((content, index) => new
      |                                   ^~~~~
a.cc:17:43: error: expected primary-expression before '>' token
   17 |                 .Select((content, index) => new
      |                                           ^
a.cc:18:17: error: expected type-specifier before '{' token
   18 |                 {
      |                 ^
a.cc:19:21: error: 'Index' was not declared in this scope
   19 |                     Index = index,
      |                     ^~~~~
a.cc:20:21: error: 'Content' was not declared in this scope
   20 |                     Content = content
      |                     ^~~~~~~
a.cc:22:24: error: 'x' was not declared in this scope
   22 |                 .Where(x => x.Content == 'a')
      |                        ^
a.cc:22:27: error: expected primary-expression before '>' token
   22 |                 .Where(x => x.Content == 'a')
      |                           ^
a.cc:23:28: error: expected primary-expression before '>' token
   23 |                 .Select(x => x.Index)
      |                            ^
a.cc:27:43: error: expected primary-expression before '>' token
   27 |                 .Select((content, index) => new
      |                                           ^
a.cc:28:17: error: expected type-specifier before '{' token
   28 |                 {
      |                 ^
a.cc:32:27: error: expected primary-expression before '>' token
   32 |                 .Where(x => x.Content == 'z')
      |                           ^
a.cc:33:28: error: expected primary-expression before '>' token
   33 |                 .Select(x => x.Index)
      |                            ^
a.cc:36:13: error: 'var' was not declared in this scope
   36 |             var new_word = word.Skip(a).Take(z - a + 1).Count();
      |             ^~~
a.cc:38:13: error: 'Console' was not declared in this scope
   38 |             Console.WriteLine(new_word);
      |             ^~~~~~~
a.cc:38:31: error: 'new_word' was not declared in this scope
   38 |             Console.WriteLine(new_word);
      |                               ^~~~~~~~