ВУЗ:
Составители:
Рубрика:
71
Array2D a2D = new Array2D(size);
a2D.print();
a2D.process();
a2D.print();
Console.ReadKey();
}
}
public class Array1D {
public int[] data;
public Array1D(int _size, Random r) {
data = new int[_size];
for (int i = 0; i < data.Length; i++) {
data[i] = r.Next(0, 100);
}
}
public void makeZiro() {
for (int i = 0; i < data.Length; i++) {
data[i] = 0;
}
}
public bool needZiro(int strIndex) {
int value = data[strIndex];
return (value % 2 == 0);
}
}
public class Array2D {
public Array1D[] columns;
public Array2D(int _size) {
columns = new Array1D[_size];
Random r = new Random();
for (int i = 0; i < columns.Length; i++) {
columns[i] = new Array1D(_size, r);//создание строки
}
}
public void printLine(int lineIndex) {
for (int i = 0; i < columns.Length; i++) {
Console.Write(columns[i].data[lineIndex].ToString().PadRight(3, '
'));
}
Console.WriteLine();
}
public void process() {
for (int i = 0; i < columns.Length; i++) {
Страницы
- « первая
- ‹ предыдущая
- …
- 69
- 70
- 71
- 72
- 73
- …
- следующая ›
- последняя »