1420 hdu Prepared for New Acmer

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



#include<iostream>
int main()
{
       int a,b,c,n;
       __int64 sum;
       scanf("%d",&n);
       while(n--)
       {
              scanf("%d%d%d",&a,&b,&c);
              sum=1;
              while(b--)
              {
                     sum=sum*a%c;
              }
             printf("%I64d\n",sum);
       }
}


你可能感兴趣的:(c,杭电)