Search found 1 match

by yeameen
Mon Nov 03, 2003 7:43 pm
Forum: Volume 105 (10500-10599)
Topic: 10515 - Powers Et Al.
Replies: 124
Views: 45408

I got TLE? whats wrong with the following code?
[c]
#include <stdio.h>

int main(void)
{
int result, m, n;

while(scanf("%d%d", &m, &n) != EOF) {
if(m == 0)
break;

result = 1;
while(n--)
result = (result * m) % 10;

printf("%d\n", result);
}

return 0;
}
[/c]

Go to advanced search