var size = int.Parse(Console.ReadLine()); List<int> arr = new List<int>(size); for (int i = 0; i < size; i++) { arr[i] = int.Parse(Console.ReadLine()); }
static void bar(ref int[] baz, int newElem){ int newLength = baz.Length + 1; int [] quux = new int [newLength]; for(int i = 0; i < baz.Length; i++) quux[i] = baz[i]; quux[newLength - 1] = newElem; baz = quux;} static void Main() { int[] foo = {1, 2, 3, 4}; foreach(int i in foo) Console.Write(i + " "); Console.WriteLine(); bar(ref foo, 42); foreach(int i in foo) Console.Write(i + " ");}
namespace Cool{ class VeryCool { static void main(string[] args) { namespace Console { WriteLine("Why isnt it possible?"); } } }}