杭电ACM 2035 人见人爱A^B

来源:互联网 发布:盗版广联达软件多少钱 编辑:程序博客网 时间:2024/04/29 03:04


http://acm.hdu.edu.cn/showproblem.php?pid=2035

水过

#include <iostream>using namespace std;int main(){int A,B;int res;while(cin>>A>>B){res=1;if(A==0&&B==0) break;for(int i=0;i<B;i++)res=(res*A)%1000;cout<<res<<endl;} return 0;}


原创粉丝点击