csansoon

P3.01 P79817 Powers

Sep 26th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6.     int a,b,n;
  7.     while (cin >> a >> b) {
  8.         n=a;
  9.         if (b==0) n=1;
  10.         while (b>1) {
  11.             n = n*a;
  12.             b--;
  13.         }
  14.         cout << n << endl;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment