for (int i = 0; i < N; i++) {
for (int j = N - 1; j > i; j--) {
if (mass[j - 1] > mass[j]) {
double temp = mass[j];
mass[j] = mass[j - 1];
mass[j - 1] = temp;
}
}
}
for (int i = 1; i < N; i++) {
for (int j = i; j > 0 && mass[j - 1] > mass[j]; j--) {
double temp = mass[j];
mass[j] = mass[j - 1];
mass[j - 1] = temp;
}
}