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
 
Author
eddy
 
Recommend
JGShining   |   We have carefully selected several similar problems for you:  1076 1170 1106 1159 1042 
 

Statistic | Submit | Discuss | Note

 #include<iostream>
using namespace std;
int main()
{
long long a,b;
long long i,s,c[];
while(cin>>a>>b)
{
for(i=s=;i<=;i++)
{
s=s*(a%);
s%=;
c[i%]=s;
}
cout<<c[b%]<<endl;
}
return ;
}

A hard puzzle 1097的更多相关文章

  1. hdu 1097 A hard puzzle 快速幂取模

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1097 分析:简单题,快速幂取模, 由于只要求输出最后一位,所以开始就可以直接mod10. /*A ha ...

  2. hdu 1097 A hard puzzle

    Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how ...

  3. HDOJ 1097 A hard puzzle(循环问题)

    Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how ...

  4. (杭电 1097)A hard puzzle

    A hard puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...

  5. HDOJ 1097 A hard puzzle

    Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how ...

  6. 【HDOJ】1097 A hard puzzle

    题目和1061非常相似,几乎可以复用. #include <stdio.h> ][]; int main() { int a, b; int i, j; ; i<; ++i) { b ...

  7. 数学--数论--HDU 1098 Ignatius's puzzle (费马小定理+打表)

    Ignatius's puzzle Problem Description Ignatius is poor at math,he falls across a puzzle problem,so h ...

  8. Puzzle 面向服务/切面(AOP/IOC)开发框架 For .Net

    Puzzle 面向服务/切面AOP开发框架 For .Net AOP主要实现的目的是针对业务处理过程中的切面进行提取,它所面对的是处理过程中的某个步骤或阶段,以获得逻辑过程中各部分之间低耦合性的隔离效 ...

  9. HDU5456 Matches Puzzle Game(DP)

    题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5456 Description As an exciting puzzle game for ...

随机推荐

  1. WPF设置VistualBrush的Visual属性制作图片放大镜效果

    原文:WPF设置VistualBrush的Visual属性制作图片放大镜效果 效果图片:原理:设置VistualBrush的Visual属性,利用它的Viewbox属性进行缩放. XAML代码:// ...

  2. How to fix Column 'InvariantName' is constrained to be unique 解决办法!

    Introduction When you build a web project that uses Enterprise Library Community for the Application ...

  3. UVA How Big Is It?

    题目例如以下: How Big Is It?  Ian's going to California, and he has to pack his things, including hiscolle ...

  4. Linux常见命令整理(一)

    整理一下,以备后用 cd /home 进入/home文件夹 cd .. 返回上一级文件夹  cd ../.. 返回上两级文件夹  cd 进入个人的主文件夹  cd - 返回上次所在的文件夹 pwd 显 ...

  5. ListView的操作模式的选择的更详细的解释CHOICE_MODE_MULTIPLE与CHOICE_MODE_MULTIPLE_MODAL

    本文介绍了我们将如何取得具体ListView多选择操作.本文将正确使用ListViewCHOICE_MODE_MULTIPLE要么CHOICE_MODE_MULTIPLE_MODAL时间easy误区. ...

  6. Oracle Applications Multiple Organizations Access Control for Custom Code

    档 ID 420787.1 White Paper Oracle Applications Multiple Organizations Access Control for Custom Code ...

  7. R语言和数据分析十大:购物篮分析

    提到数据挖掘,我们的第一个反应是之前的啤酒和尿布的故事听说过,这个故事是一个典型的数据挖掘关联规则.篮分析的传统线性回归之间的主要差别的差别,对于离散数据的相关性分析: 常见的关联规则: 关联规则:牛 ...

  8. CSS 之 光进入光

    一个.概念 css,层叠样式表(英语:Cascading Style Sheets.简写CSS).又称串样式列表.层次结构式样式表文件,一 种用来为结构化文档(如HTML文档或XML应用)加入样式(字 ...

  9. SplashScreenDemo

    对Java应用最常见的抱怨就是启动时间太长.这是因为Java虚拟机花费一段时间去加载所有必需的类,特别是对Swing应用,它们需要从Swing和AWT类库代码中去抽取大量的内容. 用户并不喜欢应用程序 ...

  10. php 二维数组传递给 js 问题解决记录

    需求: php从数据库中读取到二维数组.传递到js中 实现步骤: php:json_encode  →   json  →  js:eval 即在php中使用json_encode()将php的二维数 ...