当前位置:网站首页>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
边栏推荐
- Networkx drawing and common library function coordinate drawing
- Tool class: object to map hump to underline underline hump
- 软件验收测试
- Abnova circulating tumor DNA whole blood isolation, genomic DNA extraction and analysis
- Modify the jupyter notebook file path
- Composition API 前提
- from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
- Implementation of AVL tree
- 2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
- Algorithm --- bit count (kotlin)
猜你喜欢
Detailed explanation of transform origin attribute
虚拟机的作用
Basic introduction of JWT
大咖云集|NextArch基金会云开发Meetup来啦
How does an enterprise manage data? Share the experience summary of four aspects of data governance
Apache AB stress test
How can brand e-commerce grow against the trend? See the future here!
transform-origin属性详解
关于二进制无法精确表示小数
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
随机推荐
Get the city according to IP
freeswitch拨打分机号源代码跟踪
$refs: get the element object or sub component instance in the component:
Communication of components
計算機服務中缺失MySQL服務
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
$parent (get parent component) and $root (get root component)
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
How Oracle backs up indexes
Common function detect_ image/predict
【mysqld】Can't create/write to file
From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
Bindingexception exception (error reporting) processing
请教一下,监听pgsql ,怎样可以监听多个schema和table
组件的通信
The startup of MySQL installed in RPM mode of Linux system failed
Abnova immunohistochemical service solution
关于数据库数据转移的问题,求各位解答下