35657

Untitled

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