cpp: #include <stdlib.h>\n#include <stdio.h>\nint input[1000]; \nint output[1000];\n\nint main()\n{\n  int i ;\n  int inLen=1000 ; \n  int outLen = 0;\n\n  for (i=0; i<inLen; ++i) \n    input[i]= i;  \n\n#pragma omp parallel for\n  for (i=0; i<inLen; ++i) \n  {\n    output[outLen++] = input[i] ;\n  }  \n\n  printf("output[500]=%d\n",output[500]);\n\n  return 0;\n}\n
fortran: program DRB018_plusplus_orig_yes\n    use omp_lib\n    implicit none\n\n    integer :: i, inLen, outLen\n    integer :: input(1000)\n    integer :: output(1000)\n\n    inLen = 1000\n    outLen = 1\n\n    do i = 1, inLen\n        input(i) = i\n    end do\n\n    !$omp parallel do\n    do i = 1, inLen\n        output(outLen) = input(i)\n        outLen = outLen + 1\n    end do\n    !$omp end parallel do\n\n    print 100, output(500)\n    100 format ("output(500)=",i3)\nend program