hinagawa

14(ПП)

Sep 28th, 2020
856
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. using namespace std;
  3. #include <iostream>
  4. #include <omp.h>
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     int sum = 0;
  10.     cout << "Enter n=";
  11.     cin >> n;
  12. #pragma omp for
  13.     for (int i = 1; i <= 2* n; i++)
  14.     {
  15.         if (i % 2 != 0)
  16.         {
  17.           sum+=i;
  18.         }
  19.        
  20.     }cout <<"Square="<< sum << endl;
  21.  
  22.  
  23. }
  24.  
RAW Paste Data