fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. String txt = "111\n222\n333\n444\n555\n666\n777\n888\n999\n000";
  8. String[] arr = txt.Split("\n".ToCharArray());
  9. for(int i = 1; i < arr.Length; i += 2)
  10. {
  11. Console.WriteLine(arr[i]);
  12. Console.WriteLine(arr[i-1]);
  13. }
  14. if(arr.Length % 2 != 0)
  15. Console.WriteLine(arr[arr.Length - 1]);
  16. }
  17. }
Success #stdin #stdout 0.02s 33856KB
stdin
Standard input is empty
stdout
222
111
444
333
666
555
888
777
000
999