#5183: 為甚麼錯???


jimmy84711 (派大星)

學校 : 臺北市立麗山高級中學
編號 : 15724
來源 : [163.21.208.253]
最後登入時間 :
2011-07-20 09:26:48
d499. 高手求幂题(求幂系列题5) -- scientific | From: [163.21.208.253] | 發表日期 : 2011-06-13 13:26

#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int a,n,x;
long long int s=1;
while(scanf("%d %d",&a,&n)!=EOF)
{
for(x=1;x<=n;x++)
{
   s=s*a;             
                
                 }
printf("%lld",s);
}
  system("pause");
  return 0;
#5565: Re:為甚麼錯???


tigeryangname (LF2magic)

學校 : 亞東技術學院
編號 : 14455
來源 : [123.51.167.56]
最後登入時間 :
2021-10-15 17:57:25
d499. 高手求幂题(求幂系列题5) -- scientific | From: [120.96.55.159] | 發表日期 : 2011-08-11 20:22

#include
#include
int main(void)
{
int a,n,x;
long long int s=1;
while(scanf("%d %d",&a,&n)!=EOF)
{
for(x=1;x<=n;x++)
{
   s=s*a;             
                
                 }
printf("%lld",s);
}
  system("pause");
  return 0;
}
 
你確定long long int 夠?
 
#15526: Re:為甚麼錯???


hshua (hshua)

學校 : 新北市立林口高級中學
編號 : 52506
來源 : [125.228.147.181]
最後登入時間 :
2024-05-05 17:18:10
d499. 高手求幂题(求幂系列题5) -- scientific | From: [61.219.36.56] | 發表日期 : 2018-10-10 22:44

#include
#include
int main(void)
{
int a,n,x;
long long int s=1;
while(scanf("%d %d",&a,&n)!=EOF)
{
for(x=1;x<=n;x++)
{
   s=s*a;             
                
                 }
printf("%lld",s);
}
  system("pause");
  return 0;
}
 
你確定long long int 夠?


測試結果,要準備至少 1060個位數才夠 !

 
ZeroJudge Forum