Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
namespace Ccs
{
    class Program
    {
        static void Main(string[] args)
        {

//            Console.WriteLine(-10 % 3);

            var n = Int32.Parse(Console.ReadLine());

            var log = new ArrayList();
            var i = 0;
            while(n != 0)
            {
                var r = n % (Int32)Math.Pow(2, i + 1);
                log.Add( r != 0 ? 1 : 0 );
                n +=Math.Abs( r) * (i % 2 == 0 ? -1 : 1);

                Console.WriteLine(i + " " + r + " " + n);
                ++i;
            }

            for (int j = 0; j < log.Count; ++j)
                Console.Write(
                        log[log.Count-j-1]
                    );

            Console.WriteLine();
            
        }
    }
}


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:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Collections;
      |       ^~~~~~
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:38:6: error: expected ';' after class definition
   38 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void Ccs::Program::Main(int*)':
a.cc:16:13: error: 'var' was not declared in this scope
   16 |             var n = Int32.Parse(Console.ReadLine());
      |             ^~~
a.cc:18:17: error: expected ';' before 'log'
   18 |             var log = new ArrayList();
      |                 ^~~
a.cc:19:17: error: expected ';' before 'i'
   19 |             var i = 0;
      |                 ^
a.cc:20:19: error: 'n' was not declared in this scope
   20 |             while(n != 0)
      |                   ^
a.cc:22:21: error: expected ';' before 'r'
   22 |                 var r = n % (Int32)Math.Pow(2, i + 1);
      |                     ^
a.cc:23:17: error: 'log' was not declared in this scope; did you mean 'long'?
   23 |                 log.Add( r != 0 ? 1 : 0 );
      |                 ^~~
      |                 long
a.cc:23:26: error: 'r' was not declared in this scope
   23 |                 log.Add( r != 0 ? 1 : 0 );
      |                          ^
a.cc:24:21: error: 'Math' was not declared in this scope
   24 |                 n +=Math.Abs( r) * (i % 2 == 0 ? -1 : 1);
      |                     ^~~~
a.cc:24:37: error: 'i' was not declared in this scope
   24 |                 n +=Math.Abs( r) * (i % 2 == 0 ? -1 : 1);
      |                                     ^
a.cc:26:17: error: 'Console' was not declared in this scope
   26 |                 Console.WriteLine(i + " " + r + " " + n);
      |                 ^~~~~~~
a.cc:30:33: error: 'log' was not declared in this scope; did you mean 'long'?
   30 |             for (int j = 0; j < log.Count; ++j)
      |                                 ^~~
      |                                 long
a.cc:31:17: error: 'Console' was not declared in this scope
   31 |                 Console.Write(
      |                 ^~~~~~~
a.cc:35:13: error: 'Console' was not declared in this scope
   35 |             Console.WriteLine();
      |             ^~~~~~~