Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int funx(int i, int n)
- {
- int k, factorial;
- k = 1;
- if (n == 0)
- factorial = 1;
- for (i = 1; i <= n; i++)
- k = k * i;
- factorial = k;
- return k;
- }
- int main()
- {
- setlocale(LC_ALL, "rus");
- int summ, i, m, n;
- summ = 1;
- i = 0;
- puts ("Введите начала диапоона m") ;
- cin >> m;
- puts("Введите конец диапазона n");
- cin >> n;
- for (i = m; i <= n; i++)
- {
- if (i % 2 == 0)
- {
- summ = summ + funx(i, n);
- }
- }
- cout << summ<< endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement