#include #include #include #define NUMTHREADs 2 using namespace std; int main() { stringstream ss[100]; int nprocs; #pragma omp parallel { int total_threads = omp_get_num_threads(); int myid = omp_get_thread_num(); if (myid == 0) { nprocs = total_threads; ss[myid] << "Other things that thread 0 will be doing."; } else if (myid == total_threads -1) { ss[myid] << "things that the last thread will be doing."; } else { ss[myid] << "I am no. " << myid << ". I will do what I need to do."; } } for (int i=0; i> a) cout << a << " "; cout << "\n"; } return 0; }