This commit is contained in:
2024-12-14 12:19:04 +03:00
parent 1816c866f9
commit 2068aa91a0
8 changed files with 88 additions and 91 deletions

View File

@@ -1,3 +1,4 @@
#include "myalgorithms.h"
#include <iostream>
#include <vector>
@@ -25,22 +26,3 @@ void bubbleSort(std::vector<int>& v)
}
}
}
int main()
{
std::vector<int> v = {12, 15, 13, 4, 8};
// Это изменит исходную переменную
bubbleSort(v);
// Для вывода перебираем элементы вектора
// (i - это уже значение, а не индекс)
for (int i : v)
{
std::cout << i << " ";
}
std::cout << std::endl;
return 0;
}