fork(5) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string[] A = new string[] { "A", "B", "C", "D" };
  8. string[] B = new string[A.Length + 2];
  9. for (int i = 0; i < A.Length; i++)
  10. {
  11. B[i + 2] = A[i];
  12. }
  13.  
  14. for(int i=0; i<B.Length;i++)
  15. Console.WriteLine("Index: {0} Value: {1}", i, B[i]);
  16. }
  17. }
Success #stdin #stdout 0.03s 34744KB
stdin
Standard input is empty
stdout
Index: 0 Value: 
Index: 1 Value: 
Index: 2 Value: A
Index: 3 Value: B
Index: 4 Value: C
Index: 5 Value: D