void bubbleSort(int arr[], int size) {for (int i = 0; i < size - 1; i++) {for (int j = 0; j < size - i - 1; j++) {if (arr[j] > arr[j + 1]) {std::swap(arr[j], arr[j + 1]);}}}}
int main() {int n = 34;int arr[n] = {62, 55, 67, 64, 68, 56, 70, 65, 63, 59, 60, 57, 69, 58, 66, 61};
}
// Результат: 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
void bubbleSort(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
std::swap(arr[j], arr[j + 1]);
}
}
}
}
int main() {
bubbleSort(arr, n);int n = 34;
int arr[n] = {62, 55, 67, 64, 68, 56, 70, 65, 63, 59, 60, 57, 69, 58, 66, 61};
std::cout << "Sorted array in ascending order:" << std::endl;
for (int i = 0; i < n; i++) {
std::cout << arr[i] << " ";
}
return 0;
}
// Результат: 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70