人见人爱A^B
#include<stdio.h> int main() { int N,M,i,j; while(scanf("%d%d",&N,&M),N||M) { j=N; for(i=1;i<M;i++) { N=N*j; while(N>1000) N=N%1000; } printf("%d\n",N); } return 0; }
posted on 2011-04-29 16:51 more think, more gains 阅读(139) 评论(0) 编辑 收藏 举报
#include<stdio.h> int main() { int N,M,i,j; while(scanf("%d%d",&N,&M),N||M) { j=N; for(i=1;i<M;i++) { N=N*j; while(N>1000) N=N%1000; } printf("%d\n",N); } return 0; }
posted on 2011-04-29 16:51 more think, more gains 阅读(139) 评论(0) 编辑 收藏 举报