Engage with knowledgeable experts and get accurate answers on IDNLearn.com. Get timely and accurate answers to your questions from our dedicated community of experts who are here to help you.
Sagot :
Answer:
i hope you understand
mark me brainlist
Explanation:
Explanation:
#include <iostream>
#include <vector>
using namespace std;
void vector_sort(vector<int> &vec) {
int i, j, temp;
for (i = 0; i < vec.size(); ++i) {
for (j = 0; j < vec.size() - 1; ++j) {
if (vec[j] > vec[j + 1]) {
temp = vec[j];
vec[j] = vec[j + 1];
vec[j + 1] = temp;
}
}
}
}
int main() {
int size, n;
vector<int> v;
cin >> size;
for (int i = 0; i < size; ++i) {
cin >> n;
v.push_back(n);
}
vector_sort(v);
for (int i = 0; i < size; ++i) {
cout << v[i] << " ";
}
cout << endl;
return 0;
}
Thank you for being part of this discussion. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. IDNLearn.com is your reliable source for answers. We appreciate your visit and look forward to assisting you again soon.