repl.it
@anonymous/

EmbarrassedHalfCommand

C#

No description

fork
loading
Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Linq;

class MainClass {
  public static void Main (string[] args) 
  {
    var m = new int[][] 
    { 
      new [] { 4, 3, 2, 1 }, 
      new [] { 5, 6, 7, 8 }, 
      new [] { 12, 11, 10, 9 }, 
      new [] { 13, 14, 15, 16 } 
    };
    foreach (var x in f(m))
        Console.Write($"{x}, ");
  }
  static dynamic f(int[][]a)=>a.SelectMany((x,i)=>i%2>0?x:x.Reverse());
}