SaveText.Ru

Без имени
  1. int n = 17;
  2. int[][] array =
  3. {
  4.     new[] {3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3},
  5.     new[] {0, 1, 1, 1, 3, 1, 3, 0, 0, 0, 3, 1, 3, 3, 3, 0, 1},
  6.     new[] {0, 1, 1, 1, 1, 1, 3, 3, 0, 1, 1, 1, 1, 3, 3, 3, 3},
  7.     new[] {1, 1, 3, 1, 1, 1, 3, 0, 1, 1, 1, 1, 3, 1, 1, 3, 3},
  8.     new[] {3, 3, 1, 1, 3, 1, 1, 1, 0, 1, 3, 1, 1, 1, 0, 0, 1},
  9.     new[] {0, 0, 0, 1, 1, 3, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1},
  10.     new[] {3, 0, 1, 1, 3, 0, 0, 0, 1, 0, 3, 1, 3, 0, 1, 1, 0},
  11.     new[] {1, 0, 3, 1, 1, 3, 0, 3, 3, 1, 1, 1, 3, 0, 1, 0, 3},
  12.     new[] {1, 0, 1, 1, 1, 3, 3, 1, 3, 3, 1, 3, 0, 3, 3, 3, 0},
  13.     new[] {1, 1, 1, 0, 1, 0, 1, 1, 0, 3, 3, 3, 1, 3, 1, 1, 0},
  14.     new[] {1, 1, 1, 3, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1, 1, 1, 3},
  15.     new[] {1, 1, 1, 1, 1, 0, 1, 3, 0, 0, 3, 1, 1, 3, 0, 1, 3},
  16.     new[] {1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 3, 1, 0, 1, 1, 1, 1},
  17.     new[] {1, 0, 3, 1, 1, 0, 1, 0, 3, 3, 0, 1, 0, 0, 1, 1, 3},
  18.     new[] {0, 3, 0, 1, 0, 0, 3, 1, 1, 0, 1, 1, 0, 3, 1, 0, 1},
  19.     new[] {1, 0, 1, 1, 3, 1, 3, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1},
  20.     new[] {0, 1, 1, 3, 1, 0, 3, 1, 3, 0, 1, 1, 3, 0, 1, 1, 1}
  21. };
  22.  
  23.  
  24. Console.WriteLine(array.Select(x=>x.Sum()).Min());
  25. Console.WriteLine(string.Join(" ", array[array.Select(x=>x.Sum()).Min()]));
  26. Console.ReadLine();

Share with your friends:

Print