Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // factorial through while
- #include <iostream>
- using std::cout;
- using std::cin;
- using std::endl;
- void main()
- {
- setlocale(LC_ALL, "Russian");
- int a, i = 0, cntnr;
- cout << "Введите значение: "; cin >> a;
- cntnr = a - 1;
- while (i != cntnr)
- {
- a *= (++i);
- }
- cout << cntnr + 1 << "! = " << a << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement