Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "uravn.h"
- #include <iostream>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "RUSSIAN");
- int m, n;
- cout << "Введите n: ";
- cin >> n;
- cout << endl;
- cout << "Введите m: ";
- cin >> m;
- cout << endl;
- cout << "Решение: " << ((faktorial(n) + faktorial(m + 2)) / (faktorial(m) + 5)) << endl;
- return 0;
- }
- ##################
- #include "uravn.h"
- #include "cmath"
- #include <iostream>
- #include <clocale>
- double faktorial(int numb)// заголовок функции
- {
- int rezult = 1; // инициализируем переменную rezult значением 1
- for (int i = 1; i <= numb; i++) // цикл вычисления значения n!
- rezult *= i; // накапливаем произведение в переменной rezult
- return rezult; // передаём значение факториала в главную функцию
- }
- ######################
- double faktorial(int numb);
Add Comment
Please, Sign In to add comment