Language: C++

using System;
using System.Collections.Generic;
using System.Linq;

class Program {

    static int Main(string[] args) {
        List<int> inList = new List<int>();

        while (true) {
            string v = Console.ReadLine();
            if (v == "0") { break; }

            inList.Add(int.Parse(v));
        }

        for (int x = 0; x < inList.Count; x++) {
            int n = inList[x];

            List<int> list = new List<int>();
            for (int i = 0; i < n; i++) {
                x++;
                list.Add(inList[x]);
            }

            int maxValue = 0;
            for (int i = 0; i < list.Count; i++) {
                int value = list[i];
                if (maxValue < value) { maxValue = value; }

                for (int k = i + 1; k < list.Count; k++) {
                    value += list[k];
                    if (maxValue < value) { maxValue = value; }
                }
            }

            Console.WriteLine(maxValue);
        }

        return 0;
    }
}



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:7:21: error: 'string' has not been declared
    7 |     static int Main(string[] args) {
      |                     ^~~~~~
a.cc:7:30: error: expected ',' or '...' before 'args'
    7 |     static int Main(string[] args) {
      |                              ^~~~
a.cc:42:2: error: expected ';' after class definition
   42 | }
      |  ^
      |  ;
a.cc: In static member function 'static int Program::Main(int*)':
a.cc:8:9: error: 'List' was not declared in this scope
    8 |         List<int> inList = new List<int>();
      |         ^~~~
a.cc:8:14: error: expected primary-expression before 'int'
    8 |         List<int> inList = new List<int>();
      |              ^~~
a.cc:11:13: error: 'string' was not declared in this scope
   11 |             string v = Console.ReadLine();
      |             ^~~~~~
a.cc:12:17: error: 'v' was not declared in this scope
   12 |             if (v == "0") { break; }
      |                 ^
a.cc:14:13: error: 'inList' was not declared in this scope
   14 |             inList.Add(int.Parse(v));
      |             ^~~~~~
a.cc:14:24: error: expected primary-expression before 'int'
   14 |             inList.Add(int.Parse(v));
      |                        ^~~
a.cc:17:29: error: 'inList' was not declared in this scope
   17 |         for (int x = 0; x < inList.Count; x++) {
      |                             ^~~~~~
a.cc:20:18: error: expected primary-expression before 'int'
   20 |             List<int> list = new List<int>();
      |                  ^~~
a.cc:23:17: error: 'list' was not declared in this scope
   23 |                 list.Add(inList[x]);
      |                 ^~~~
a.cc:27:33: error: 'list' was not declared in this scope
   27 |             for (int i = 0; i < list.Count; i++) {
      |                                 ^~~~
a.cc:37:13: error: 'Console' was not declared in this scope
   37 |             Console.WriteLine(maxValue);
      |             ^~~~~~~