ВУЗ:
Составители:
Рубрика:
75
namespace ConsoleApplication17 {
class Program {
static void Main() {
Console.Write("Введите размер массива: ");
int size = Int32.Parse(Console.ReadLine());
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, 10);
}
}
public int getCount(int curValue) {
int count = 0;
for (int i = 0; i < data.Length; i++) {
if (data[i] == curValue) {
count++;
}
}
return count;
}
public bool needDel() {
for (int i = 0; i < data.Length; i++) {
if (getCount(data[i]) > 1) {
return true;
}
}
return false;
}
}
public class Array2D {
public Array1D[] columns;
public void delColumn(int colIndex) {
Array1D[] newColumns = new Array1D[columns.Length - 1];
for (int i = 0; i < colIndex; i++) {
newColumns[i] = columns[i];
}
for (int i = colIndex; i < newColumns.Length; i++) {
Страницы
- « первая
- ‹ предыдущая
- …
- 73
- 74
- 75
- 76
- 77
- …
- следующая ›
- последняя »