B - B

Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Submit Status

Description

求A^B的最后三位数表示的整数。 
说明:A^B的含义是“A的B次方” 
 

Input

输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1<=A,B<=10000),如果A=0, B=0,则表示输入数据的结束,不做处理。
 

Output

对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。 
 

Sample Input

2 3
12 6
6789 10000
0 0
 

Sample Output

8
984
1
 
 #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int a,b;
while(scanf("%d%d",&a,&b)&&(a!=||b!=))
{
int num=;
for(int i=;i<b;i++)
{
num*=a%;
num%=;
}
printf("%d\n",num%);
}
}

CDZSC_2015寒假新人(2)——数学 B的更多相关文章

  1. CDZSC_2015寒假新人(2)——数学 P

    P - P Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  2. CDZSC_2015寒假新人(2)——数学 H

    H - H Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  3. CDZSC_2015寒假新人(2)——数学 G

    G - G Time Limit:3000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  4. CDZSC_2015寒假新人(2)——数学 D

    D - D Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  5. CDZSC_2015寒假新人(2)——数学 C

    C - C Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  6. CDZSC_2015寒假新人(2)——数学 A

    A - A Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  7. CDZSC_2015寒假新人(1)——基础 i

    Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you mus ...

  8. CDZSC_2015寒假新人(1)——基础 h

    Description Ignatius was born in a leap year, so he want to know when he could hold his birthday par ...

  9. CDZSC_2015寒假新人(1)——基础 g

    Description Ignatius likes to write words in reverse way. Given a single line of text which is writt ...

随机推荐

  1. angularjs如何在ng-repeat过程中控制字符串长度超过指定长度后面内容以省略号显示

    angular.module('ng').filter('cut', function () { return function (value, wordwise, max, tail) { if ( ...

  2. mysql索引之普通索引

    1,普通索引的创建 普通索引可以在建表的时候创建 sql : create table temp2(id int(10) not null auto_increment ,title varchar( ...

  3. android 点击水波纹效果

    这里是重点,<ripple>是API21才有的新Tag,正是实现水波纹效果的; 其中<ripple android:color="#FF21272B" .... ...

  4. 丰富的else语句及简洁的with语句 - 零基础入门学习Python034

    丰富的else语句及简洁的with语句 让编程改变世界 Change the world by program 丰富的else语句 有鱼油可能会说,else语句还有啥好讲的?经常跟if语句进行搭配用于 ...

  5. 使用Japserreport填充报表数据(3)

    E中以PDF文件的格式显示静态的中文字符串,在大多数的情况下,打印的数据来自于一些变量,在JasperReports工具中传递数据并填充到 报表只有两种方式,即使用Parameters参数和JRDat ...

  6. [HDU] 1394 Minimum Inversion Number [线段树求逆序数]

    Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  7. 开心菜鸟系列学习笔记-------javascript(3)

    一.原型链:     1)Object 是一个属性的集合,并且都拥有一个单独的原型对象.,这个原型对象object可以是一个object或者null值 2)不过一般来说,我们会使用__内部属性名__下 ...

  8. 【ROC曲线】关于ROC曲线、PR曲线对于不平衡样本的不敏感性分析说引发的思考

    ROC曲线 在网上有很多地方都有说ROC曲线对于正负样本比例不敏感,即正负样本比例的变化不会改变ROC曲线.但是对于PR曲线就不一样了.PR曲线会随着正负样本比例的变化而变化.但是没有一个有十分具体和 ...

  9. Honkly分享链接集总篇

    VC6.0 Filetool Honkly版         http://pan.baidu.com/s/1bnentr5 密码:15eq,解压密码:honkly VC6.0 Filetool 官方 ...

  10. commons.fileupload简单应用

    导入包: commons-fileupload-1.3.1.jar commons-io-2.4.jar commons-fileupload依赖于commons-io,commons-io-2.4必 ...