New students) In addition to the school race, what avenues can you apply to join the ACM school team?
|
People see Love a^b timelimit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) Total submission (s): 33751 Accepted Submission (s): 22894
Problem description An integer representing the last three digits of the a^b. Description: The meaning of A^b is "A's B-square" Input data contains multiple test instances, one row per instance, consisting of two positive integers a and B (1<=a,b<=10000), and if a=0, b=0, indicates the end of the input data and does not process. Output for each test instance, print the last three bits of the a^b that represent the integers, one row for each output. Sample Input2 312 66789 100000 0 Sample Output89841 |
#include <stdio.h>
#include <math.h>
int main ()
{
int n,m,a,i;
while (scanf ("%d%d", &n,&m)!=eof)
{
if (n==0&&m==0)
return 0;
A=n;
for (i=1;i<m;i++)
{n=n%1000;
N=n*a;
}
printf ("%d\n", N);
}
return 0;
}*/
Hangzhou Electric 2035 People see people love a^b