35657

Untitled

Oct 28th, 2023
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.     setlocale(LC_ALL, "ru");
  8.    
  9.     int number;
  10.     int fact = 1;
  11.  
  12.     cout << "Введите число: ";
  13.     cin >> number;
  14.  
  15.     int i = 1;
  16.  
  17.     while (i <= number) {
  18.         fact *= i;
  19.         i++;
  20.     }
  21.     cout << fact << endl;
  22. }
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment