Rightmost Digit
来源:互联网 发布:java写数据到txt 编辑:程序博客网 时间:2024/05/01 22:34
Rightmost Digit
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 5 Accepted Submission(s) : 2
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
Given a positive integer N, you should output the most right digit of N^N.
Input
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case contains a single positive integer N(1<=N<=1,000,000,000).
Each test case contains a single positive integer N(1<=N<=1,000,000,000).
Output
For each test case, you should output the rightmost digit of N^N.
Sample Input
234
Sample Output
76
Hint
In the first case, 3 * 3 * 3 = 27, so the rightmost digit is 7.
In the second case, 4 * 4 * 4 * 4 = 256, so the rightmost digit is 6.
In the second case, 4 * 4 * 4 * 4 = 256, so the rightmost digit is 6.
Author
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- 手机游戏项目《Aaron’sGreatEscape》实施方案(一)
- 类在什么时候加载和初始化
- Windows Programming 第一章 起步
- wikioi 1045 回文数
- 并联电器补偿无功功率
- Rightmost Digit
- 稳压管的使用与选取
- 基于visual Studio2013解决C语言竞赛题之0908文件合并
- Wireshark抓包工具使用教程以及常用抓包规则
- TFS2013 体验-代码审查
- easy ui 翻页信息的传递
- Spring3.0 注解小结
- RGB颜色表
- Django Admin外键选择的自动完成