-1])) {
temp = kop [i];
kop [i] = kop [i/2-1];
kop [i/2-1] = temp;
i = i/2-1;
}
else if ((i% 2 == 1) && (kop [i]> kop [i/2])) {
temp = kop [i];
kop [i] = kop [i/2];
kop [i/2] = temp;
i = i/2;
}
else b = 0;
}
} = razmer; (g> 0) {= kop [0]; [0] = kop [g-1]; [g-1] = temp; -;
i = 0; b = 1;
while ((b) && (i * 2 +1
if ((kop [i] = kop [i * 2 +2]) && ; (i * 2 +1
temp = kop [i];
kop [i] = kop [i * 2 +1];
kop [i * 2 +1] = temp;
i = i * 2 +1;
}
else if ((kop [i] = kop [i * 2 +1]) & & (i * 2 +2
temp = kop [i];
kop [i] = kop [i * 2 +2];
kop [i * 2 +2] = temp;
i = i * 2 +2;
}
else if ((kop [i]
if ((kop [i * 2 +1]
temp = kop [i];
kop [i] = kop [i * 2 +2];
kop [i * 2 +2] = temp;
i = i * 2 +2;
}
else {
temp = kop [i];
kop [i] = kop [i * 2 +1];
kop [i * 2 +1] = temp;
i = i * 2 +1;
}
}
else b = 0;
}
}
} massiv (int * & kop, int razmer, int metod) {(metod == 1) {
for (int i = 0; i
kop [i] = random (razmer);
} (metod == 2) {
for (int i = 0; i
kop [i] = i;
} (metod == 3) {
for (int i = razmer-1; i> = 0; i -)
kop [i] = razmer-i-1;
} 0;
}
Файл FILE.CPP
# include
# include
# include File (int * & kop, int k, int razmer) {* out; ((out = fopen ("c: BORLANDC BIN . txt "," w ")) == NULL) {(stderr," Cannot open output file. n "); 1;} (k == 1) {
for (int i = 0...