当前位置:网站首页>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
边栏推荐
- Pass parent component to child component: props
- [explanation of JDBC and internal classes]
- toRefs API 与 toRef Api
- Lvs+kept (DR mode) learning notes
- sql中对集合进行非空校验
- How does an enterprise manage data? Share the experience summary of four aspects of data governance
- Abnova membrane protein lipoprotein technology and category display
- Master-slave replication principle of MySQL
- Release notes of JMeter version 5.5
- JS small exercise
猜你喜欢

Basic introduction of JWT

計算機服務中缺失MySQL服務

Use of completable future

Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing

Freeswitch dials extension number source code tracking

Abnova immunohistochemical service solution

freeswitch拨打分机号源代码跟踪

Asynchronous components and suspend (in real development)
![[noi simulation] regional division (conclusion, structure)](/img/7d/4c66cd0a30e52ccd167b6138fcb4df.png)
[noi simulation] regional division (conclusion, structure)

sql中对集合进行非空校验
随机推荐
LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
Procedure in PostgreSQL supports transaction syntax (instance & Analysis)
Abnova immunohistochemical service solution
大咖云集|NextArch基金会云开发Meetup来啦
js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
Mobx knowledge point collection case (quick start)
Torefs API and toref API
Leetcode t1165: log analysis
组件的嵌套和拆分
Answer to the second stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
Nesting and splitting of components
JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
Detailed explanation of transform origin attribute
Bus message bus
MySQL user permissions
[noi simulation] regional division (conclusion, structure)
Use of completable future
关于数据库数据转移的问题,求各位解答下
Release notes of JMeter version 5.5