Advertisement
Guest User

lab4

a guest
Apr 8th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <omp.h>
  2. #include <stdio.h>
  3. #include <Windows.h>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int rank, k;
  11.     cin >> k;
  12.  
  13. #pragma omp parallel num_threads(k) //private (rank)
  14.     {
  15.         rank = omp_get_thread_num();
  16.         Sleep(100);
  17.         printf("I am %d thread.\n", rank);
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement