// bsp8a.cpp : Sectionsaufteilung


#include "stdafx.h"

#include <omp.h>

using namespace System;

int main(array<System::String ^> ^args) {
	const int MAX=4;
	
	int tid;
	

	 omp_set_num_threads(MAX);


     #pragma omp parallel sections private(tid) 
	 {
		#pragma omp section
		{
				tid = omp_get_thread_num();  
				Console::WriteLine("Section 1  id: {0}   AnzThread: {1}", tid, omp_get_num_threads());
		}
		#pragma omp section
		{
				tid = omp_get_thread_num();  
				Console::WriteLine("Section 2  id: {0}   AnzThread: {1}", tid, omp_get_num_threads());
		}
		#pragma omp section
		{
				tid = omp_get_thread_num();  
				Console::WriteLine("Section 3  id: {0}   AnzThread: {1}", tid, omp_get_num_threads());
		}
		#pragma omp section
		{
				tid = omp_get_thread_num();  
				Console::WriteLine("Section 4  id: {0}   AnzThread: {1}", tid, omp_get_num_threads());
		}
		#pragma omp section
		{
				tid = omp_get_thread_num();  
				Console::WriteLine("Section 5  id: {0}   AnzThread: {1}", tid, omp_get_num_threads());
		}

	 }
	Console::ReadLine();	

	return 0;
}
