// bsp2.cpp : Defines the entry point for the console application.


#include "stdafx.h"

#ifdef _OPENMP
 #include <omp.h>
#endif



int _tmain(int argc, _TCHAR* argv[])
{
	const int MAX = 10;
	int a[MAX];	
	//omp_set_num_threads(7);
	#pragma omp parallel for
		for (int i = 0; i < MAX; ++i)  {
			int id=omp_get_thread_num();  // Thread ID
			a[i]=id;			// wird aufgeteilt auf die Threads
			printf("i: %d  Thread-id:%d\n",  i, id  );
		}

	puts("\nErgebnis:");
	for (int i = 0; i < MAX; ++i) {
		printf("A[ %d ] = %d\n",       i, a[i]    );
	}
	char ch[20];
	gets(ch);
	return 0;
}

