blob: 975c49579c1a874a3c6c2c992bd3aaf8d56eba1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include <omp.h>
#include <stdio.h>
int main() {
long long int total = 1, i;
#pragma omp parallel for reduction(*:total)
for(i = 1; i <= 20; i++) {
// printf("working in thread %d\n", omp_get_thread_num());
total = total * i;
}
printf("total: %lld\n", total);
}
|