问题一百五十二:人见人爱的A^B
[plain] #include <stdio.h>
int main()
{
int i;
int n;
int m;
int sum;
while(scanf("%d %d", &n, &m)!=EOF && (n!=0 || m!=0))
{
sum=1;
for(i=1; i<=m; i++)
{
sum=((n%1000)*sum)%1000;
}
printf("%d\n", sum);
}
return 0;
}
#include <stdio.h>
int main()
{
int i;
int n;
int m;
int sum;
while(scanf("%d %d", &n, &m)!=EOF && (n!=0 || m!=0))
{
sum=1;
for(i=1; i<=m; i++)
{
sum=((n%1000)*sum)%1000;
}
printf("%d\n", sum);
}
return 0;
}
结果图:
补充:软件开发 , C语言 ,