View Code of Problem 3696

#include <stdio.h>
void main()
{
	int n,t,i;
	while(scanf("%d",&n) != EOF)
	{
		t=n;
		for(i=1;i<n;i++)
		{
			t =t%10;
			t =t*n;
		}
		printf("%d\n",t%10);
	}
}

Double click to view unformatted code.


Back to problem 3696