1831The Gate to Freedom

1831   The Gate to Freedom

题目描述

Background

It is dark at night.
It is silence at night.
It is she in the dark.
It is she in the silence.

Then a light appeared. A huge gate came into our sights, called

The Gate to Freedom


Problem

There're some words on the gate: "This gate will lead you to freedom. First, you have to open it. I have a problem for you to solve, if you answer it correctly, the gate will open!"

"Tell me, young boy, what is the leftmost digit of N^N?"

输入格式:

This problem contains multiple test cases.

Each test case contains an integer N (N<=1,000,000,000).

输出格式:

For each test case, output the leftmost digit of N^N.

输入样例 复制
3
4
输出样例 复制
2
2

说明

10
48
通过提交
时空限制2000ms/64mb
题目来源
评测方式在线评测
题目类型基础强化
难        度