BUPT-homework/semester1/pset3/2-power.c

18 lines
254 B
C

#include <stdio.h>
int main(void) {
// Initialize values and get input
int a, b, c = 1;
scanf("%d%d", &a, &b);
// Iterate and calculate result
for (int i = 0; i < b; i++) {
c *= a;
}
// Print answer
printf("%d\n", c);
return 0;
}