当前位置:网站首页>1090: integer power (multi instance test)
1090: integer power (multi instance test)
2022-07-07 07:17:00 【Huaze flowers】
Title Description
seek A^B An integer represented by the last three digits of (1<=A,B<=1000)
Input
n A test case , Each instance gives two positive integers A,B
Output
Output A^B The last three ( There is no forerunner 0)
The sample input
2 2 3 12 6
Sample output
8 984
Code :
// Find the power of an integer ,A^B
// After the output number 3 position
// Input :
//2
//2 3
//12 6
// Output :
//8
//984
#include <stdio.h>
int main ()
{
int n;
scanf("%d",&n);
int a,b;
int i,j;
int sum;
for(i=0;i<n;i++)
{
scanf("%d %d",&a,&b);
sum=1;
for(j=0;j<b;j++)
{
sum*=a;
while(sum>1000)
{
sum=sum%1000;
}
}
printf("%0d\n",sum);
}
return 0;
}Running results :

Submit :
![]()
But I still have one thing I don't understand , As shown in the following figure , It should be right to write logic like this

But submit , will not pass ![]()
If that big guy knows , Hope to inform
边栏推荐
- Bindingexception exception (error reporting) processing
- 关于数据库数据转移的问题,求各位解答下
- js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
- How to model and simulate the target robot [mathematical / control significance]
- Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park
- The currently released SKU (sales specification) information contains words that are suspected to have nothing to do with baby
- MySQL service is missing from computer service
- 云备份项目
- Explain Bleu in machine translation task in detail
- Circulating tumor cells - here comes abnova's solution
猜你喜欢

Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park

Leetcode t1165: log analysis

Lm11 reconstruction of K-line and construction of timing trading strategy

Config distributed configuration center

虚拟机的作用

Jetpack compose is much more than a UI framework~

$parent (get parent component) and $root (get root component)

.net core 访问不常见的静态文件类型(MIME 类型)

SQLMAP使用教程(四)实战技巧三之绕过防火墙

This article introduces you to the characteristics, purposes and basic function examples of static routing
随机推荐
JS small exercise
弹性布局(二)
Sword finger offer high quality code
OOM(内存溢出)造成原因及解决方案
父组件传递给子组件:Props
readonly 只读
Flexible layout (I)
Asynchronous components and suspend (in real development)
Stack Title: nesting depth of valid parentheses
oracle如何备份索引
PostgreSQL source code (59) analysis of transaction ID allocation and overflow judgment methods
After the promotion, sales volume and flow are both. Is it really easy to relax?
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
Jesd204b clock network
ViewModelProvider. Of obsolete solution
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
修改Jupyter Notebook文件路径
main函数在import语句中的特殊行为
非父子组件的通信
Hidden Markov model (HMM) learning notes