#include<stdio.h>#include<stdlib.h>#defineA2#defineB7staticintquick_pow(int a,int b){int res, temp;
res =1;
temp = a;while(b >0){if(b %2==1){
res *= temp;}
b /=2;
temp *= temp;}return res;}intmain(int argc,char*argv[]){// res = a^bint a, b, res;if(argc <3){fprintf(stderr,"Usage:%s a b\n", argv[0]);exit(1);}
a =atoi(argv[1]);
b =atoi(argv[2]);
res =quick_pow(a, b);printf("res = %d\n", res);exit(0);}