A hard puzzle

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 25563    Accepted Submission(s): 9084

Problem Description
lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.
this puzzle describes that: gave a and b,how to know the a^b’s the last digit number.But everybody is too lazy to slove this problem,so they remit to you who is wise.
Input
There are mutiple test cases. Each test cases consists of two numbers a and b(0<a,b<=2^30)
Output
For each test case, you should output the a^b’s last digit number.
Sample Input
7 66 8 800
Sample Output
9 6

一道找规律的题目，研究一下会发现末位数都是有规律的，都是4的倍数

1是1、1、1、1
2是2、4、8、6
3是3、9、7、1
4是4、6、4、6
5是5、5、5、5
6是6、6、6、6
7是7、9、3、1
8是8、4、2、6
9是9、1、9、1

HDOJ2007：平方和与立方和

Problem Description

Input

Output

Sample Input

1 3

2 5

Sample Output

4 28

20 152

Author

lcy

Source

C语言程序设计练习（一）

Recommend

JGShining

• 如果输入的两数大小颠倒的话也要保证能够正常输出
• 脑残了，第一次做这个题的时候输入的是%c%c，纠结了好久找不到错……

【ACM】ACM steps 1.1.7

A+B for Input-Output Practice (VII)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 19199 Accepted Submission(s): 12214

Problem Description
Your task is to Calculate a + b.

Input
The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.

Output
For each pair of input integers a and b you should output the sum of a and b, and followed by a blank line.

Sample Input
1 5
10 20

Sample Output
6

30
参考题解：

很简单的一道题……
但是有更简单的做法

这貌似是这道题最简单的做法了……