private static void ClearExceptCircle(int[,] array, int row, int column, int radius) {
int rowCount = array.GetLength(0);
int colCount = array.GetLength(1);
for (int r = 0; r < rowCount; ++r)
for (int c = 0; c < colCount; ++c)
if ((row - r) * (row - r) + (column - c) * (column - c) > radius * radius)
private static void Show(int[,] array) {
int rowCount = array.GetLength(0);
int colCount = array.GetLength(1);
for (int r = 0; r < rowCount; ++r) {
for (int c = 0; c < colCount; ++c) {
Console.Write(array[r, c]);
private static int[,] Build(int rows, int cols) {
int[,] result = new int[rows, cols];
for (int r = 0; r < rows; ++r)
for (int c = 0; c < cols; ++c)
result[r, c] = (c + 1) % 10;
public static void Main()
Console.WriteLine("Before:");
int[,] array = Build(5, 10);
Console.WriteLine("After:");
ClearExceptCircle(array, 2, 4, 2);