当前位置:网站首页>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
边栏推荐
- js小练习
- Abnova immunohistochemical service solution
- Kuboard无法发送邮件和钉钉告警问题解决
- Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing
- oracle如何备份索引
- From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
- Kuboard can't send email and nail alarm problem is solved
- Big coffee gathering | nextarch foundation cloud development meetup is coming
- Please tell me how to monitor multiple schemas and tables by listening to PgSQL
- 软件验收测试
猜你喜欢
Bindingexception exception (error reporting) processing
Use of completable future
关于数据库数据转移的问题,求各位解答下
Network foundation - header, encapsulation and unpacking
After the promotion, sales volume and flow are both. Is it really easy to relax?
Flexible layout (I)
How DHCP router works
Jetpack compose is much more than a UI framework~
MySQL view bin log and recover data
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
随机推荐
FPGA course: application scenario of jesd204b (dry goods sharing)
Chinese and English instructions prosci LAG-3 recombinant protein
SQLMAP使用教程(四)实战技巧三之绕过防火墙
Libcurl returns curlcode description
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
Non empty verification of collection in SQL
选择商品属性弹框从底部弹出动画效果
transform-origin属性详解
Lvs+kept (DR mode) learning notes
Abnova membrane protein lipoprotein technology and category display
How Oracle backs up indexes
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
Nesting and splitting of components
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
Bus message bus
Flexible layout (II)
Stack Title: nesting depth of valid parentheses
How does an enterprise manage data? Share the experience summary of four aspects of data governance
.net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context