Language: C++

using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] inputs = new string[n];
            bool result = true;

            for(int i= 0;i < n; i++)
            {
                inputs[i] = Console.ReadLine();
            }

            for(int i= 0; i<n-1; i++)
            {
                if (!Judge(inputs, i, n)) {
                    result = false;
                    break;
                }

            }

            if (result) Console.WriteLine("Yes");
            else Console.WriteLine("No");


        }

        static bool Judge(string[] strs, int index, int n)
        {
            char[] chr1 = strs[index].ToCharArray();
            char[] chr2 = strs[index + 1].ToCharArray();
            for(int i = 0;i < n; i++)
            {
                if (strs[index] == strs[i] && index != i) return false;
            }
            return chr1[chr1.Length - 1] == chr2[0];
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:33:27: error: 'string' has not been declared
   33 |         static bool Judge(string[] strs, int index, int n)
      |                           ^~~~~~
a.cc:33:36: error: expected ',' or '...' before 'strs'
   33 |         static bool Judge(string[] strs, int index, int n)
      |                                    ^~~~
a.cc:43:6: error: expected ';' after class definition
   43 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApp2::Program::Main(int*)':
a.cc:9:21: error: expected primary-expression before 'int'
    9 |             int n = int.Parse(Console.ReadLine());
      |                     ^~~
a.cc:10:13: error: 'string' was not declared in this scope
   10 |             string[] inputs = new string[n];
      |             ^~~~~~
a.cc:10:20: error: expected primary-expression before ']' token
   10 |             string[] inputs = new string[n];
      |                    ^
a.cc:15:17: error: 'inputs' was not declared in this scope
   15 |                 inputs[i] = Console.ReadLine();
      |                 ^~~~~~
a.cc:15:29: error: 'Console' was not declared in this scope
   15 |                 inputs[i] = Console.ReadLine();
      |                             ^~~~~~~
a.cc:20:28: error: 'inputs' was not declared in this scope
   20 |                 if (!Judge(inputs, i, n)) {
      |                            ^~~~~~
a.cc:27:25: error: 'Console' was not declared in this scope
   27 |             if (result) Console.WriteLine("Yes");
      |                         ^~~~~~~
a.cc:28:18: error: 'Console' was not declared in this scope
   28 |             else Console.WriteLine("No");
      |                  ^~~~~~~
a.cc: In static member function 'static bool ConsoleApp2::Program::Judge(int*)':
a.cc:35:17: error: structured binding declaration cannot have type 'char'
   35 |             char[] chr1 = strs[index].ToCharArray();
      |                 ^~
a.cc:35:17: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:35:17: error: empty structured binding declaration
a.cc:35:20: error: expected initializer before 'chr1'
   35 |             char[] chr1 = strs[index].ToCharArray();
      |                    ^~~~
a.cc:36:17: error: structured binding declaration cannot have type 'char'
   36 |             char[] chr2 = strs[index + 1].ToCharArray();
      |                 ^~
a.cc:36:17: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:36:17: error: empty structured binding declaration
a.cc:36:20: error: expected initializer before 'chr2'
   36 |             char[] chr2 = strs[index + 1].ToCharArray();
      |                    ^~~~
a.cc:37:31: error: 'n' was not declared in this scope
   37 |             for(int i = 0;i < n; i++)
      |                               ^
a.cc:39:21: error: 'strs' was not declared in this scope
   39 |                 if (strs[index] == strs[i] && index != i) return false;
      |                     ^~~~
a.cc:39:26: error: 'index' was not declared in this scope
   39 |                 if (strs[index] == strs[i] && index != i) return false;
      |                          ^~~~~
a.cc:41:20: error: 'chr1' was not declared in this scope
   41 |             return chr1[chr1.Length - 1] == chr2[0];
      |                    ^~~~
a.cc:41:45: error: 'chr2' was not declared in this scope
   41 |             return chr1[chr1.Length - 1] == chr2[0];
      |                                             ^~~~