#include <iostream>
#include <omp.h>
using namespace std;
int main() {
printf("Fibonacci Series\n\n");
int n = 10;
int fib[n];
fib[0] = fib[1] = 1;
#pragma omp parallel
{
#pragma omp for ordered
for (int i = 2; i < n; i++)
{
#pragma omp ordered
{
fib[i] = fib[i-1] + fib[i-2];
printf("Fib[%d] = %d\n", i, fib[i]);
}
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8b21wLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CnByaW50ZigiRmlib25hY2NpIFNlcmllc1xuXG4iKTsKaW50IG4gPSAxMDsKaW50IGZpYltuXTsKZmliWzBdID0gZmliWzFdID0gMTsKCiNwcmFnbWEgb21wIHBhcmFsbGVsCiAgICB7CiAgICAjcHJhZ21hIG9tcCBmb3Igb3JkZXJlZAogICAgZm9yIChpbnQgaSA9IDI7IGkgPCBuOyBpKyspCiAgICAgICAgewogICAgICAgICNwcmFnbWEgb21wIG9yZGVyZWQKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgZmliW2ldID0gZmliW2ktMV0gKyBmaWJbaS0yXTsKICAgICAgICAgICAgICAgIHByaW50ZigiRmliWyVkXSA9ICVkXG4iLCBpLCBmaWJbaV0pOwogICAgICAgICAgICB9CiAgICAgICAgfQogwqDCoMKgfQpyZXR1cm7CoDA7Cn0=