using System;
namespace App {
internal class Program {
private static void Main() {
var a = new[,] {{1, 2, 3}, {1, 2, 3}, {1, 2, 3}};
for (var j = 0; j <= a.GetUpperBound(1); j++) {</p>
if (j % 2 == 0)
a[0, j] = ColumnSum(j, ref a);
else
a[0, j] = ColumnProduct(j, ref a);
}
for (var i = 0; i <= a.GetUpperBound(0); i++) {</p>
for (var j = 0; j <= a.GetUpperBound(1); j++)</p>
Console.Write("{0} ", a[i, j]);
Console.WriteLine();
}
Console.WriteLine();
Console.ReadLine();
}
public static int ColumnSum(int column, ref int[,] a) {
var sum = 0;
for (var i = 0; i <= a.GetUpperBound(0); i++) {</p>
sum += a[i, column];
}
return sum;
}
public static int ColumnProduct(int column, ref int[,] a) {
var p = 1;
for (var i = 0; i <= a.GetUpperBound(0); i++) {</p>
p *= a[i, column];
}
return p;
}
}
}