Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <windows.h>
- #include <iostream>
- #include <omp.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- omp_set_num_threads(8);
- int i = 0;
- #pragma omp parallel reduction (+: i)
- {
- i++;
- printf("Thread %i ", omp_get_thread_num(), ".\n");
- cout << "Hello World!\n";
- }
- cout << "Кол-во пот потоков: " << i << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement