题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2035

#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, char *argv[])
{
    int A,B;
    while(cin>>A>>B)
    {
      int sum=1;
      if(A==0&&B==0)
        break;
      for(int i=0;i<B;i++)
      {
         sum=sum*A%1000;
      }
      cout<<sum<<endl;
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}

这题把自己迷惑了,考虑的比较复杂,思路还不对,参考网友的代码,自己豁然开朗!

相关文章:

  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2021-08-14
  • 2021-09-05
猜你喜欢
  • 2021-10-13
  • 2021-12-27
  • 2021-10-10
  • 2021-10-05
  • 2021-06-22
  • 2021-08-31
  • 2022-12-23
相关资源
相似解决方案