Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <thread>
- using namespace std;
- void sor(vector<int> d, int k, int h) {
- sort(&d[k], &d[h]);
- }
- int main() {
- vector<int> a(5);
- for (int i = 0; i < 5; i++) {
- cin >> a[i];
- }
- thread t1(sort<int*>, &a[0], &a[2]);
- thread t2(sort<int*>, &a[3], &a[4]);
- t1.join();
- t2.join();
- for (int i = 0; i < 5; i++) {
- cout << a[i] << " ";
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement