SHARE
TWEET

Untitled

a guest Jun 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int funx(int i, int n)
  6. {
  7.     int k, factorial;
  8.     k = 1;
  9.     if (n == 0)
  10.         factorial = 1;
  11.     for (i = 1; i <= n; i++)
  12.         k = k * i;
  13.     factorial = k;
  14.     return k;
  15. }
  16. int main()
  17. {
  18.     setlocale(LC_ALL, "rus");
  19.     int  summ, i, m, n;
  20.     summ = 1;
  21.     i = 0;
  22.     puts ("Введите начала диапоона m") ;
  23.     cin >> m;
  24.     puts("Введите конец диапазона n");
  25.     cin >> n;
  26.     for (i = m; i <= n; i++)
  27.     {
  28.         if (i % 2 == 0)
  29.         {
  30.             summ = summ + funx(i, n);
  31.  
  32.         }
  33.     }  
  34.     cout << summ<< endl;
  35.     system("pause");
  36.     return 0;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top