#include<stdio.h>
int exp(int a, long long n,int mod)
{
__int64 temp1 = 1, temp2 =a;
while(n)
{
if(n & 1)
temp1 =( temp1 * temp2 ) % mod;
n>>=1;
temp2 =( temp2 * temp2 ) % mod;
}
return temp1;
} //快速幂
int main()
{
int t,ans;
__int64 n;
while(~scanf("%d",&t)&&t)
{
int i;
for(i=1;i<=t;i++)
{
scanf("%I64d",&n);
n--;
ans=exp(2,n,100);
printf("Case %d: %d\n",i,ans*(ans+1)%100);
}
printf("\n");
}
}
HDU2065快速幂 数学题
最新推荐文章于 2021-05-06 17:11:36 发布