• [1266] Flandre's Puzzle

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Flandre is not a clever girl, she always puzzled in math problems, and gets bogged deeper and deeper, this day she screamed as usual:" Oh my god, my head is full of one two three, I think my head is becoming bigger, I don't want to calculate A^B anymore!". To stop her from screaming, you have to help her solve his problem: get the last digit of a^b,hard or not? You can do it!
  • 输入
  • There are several test case. Each contains two integers A(0 <= A <= 6000000) and B(1 <= B <= 6000000).
  • 输出
  • For each test case, output the last digit of A^B.There is a blank line between two cases.
  • 样例输入
  • 2 2
    2 3
  • 样例输出
  • 4
    
    8
    
  • 提示
  • 来源
  • Mr.Cai
  • 操作

显示春菜