Advertisement
Josif_tepe

Untitled

Mar 13th, 2023
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int a, b;
  5.     cin >> a >> b;
  6.    
  7.     if(a < b) {
  8.         int stepen = 1;
  9.         for(int i = 1; i <= b; i++) {
  10.             stepen *= a;
  11.         }
  12.         cout << stepen << endl;
  13.     }
  14.     if(b < a) {
  15.         int stepen2 = 1;
  16.         for(int i = 1; i <= a; i++) {
  17.             stepen2 *= b;
  18.         }
  19.         cout << stepen2 << endl;
  20.     }
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement