摘要:
#include"stdio.h"int qpow(int a,int b){ int s=1; while(b) { if(b%2)s=(s*a)%10; a=(a*a)%10; b=b>>1; } return s%10;}int main( ){ int a,b; while(scanf("%d%d",&a,&b)==2) { printf("%d\n",qpow(a%10,b)); } return 0;} 阅读全文
posted @ 2012-01-31 23:07
朝圣の路
阅读(119)
评论(0)
推荐(0)

浙公网安备 33010602011771号