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

这道题目考察的是余数,因为((a%c)*(b%c))%b=(a*b)%c;所以这道题目就很简单了哦,相信你做了之后也会这样认为的。。。

代码::

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

int main()

{

    int n,m,k;

    while(scanf("%d%d",&n,&m),n&&m)

    {

            k=1;

            while(m--)

            {

                    k=k*(n%1000);

                    k=k%1000;

            } 

            printf("%d\n",k);

    } 

   // system("pause");

    return 0;

}

相关文章:

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