当前位置:网站首页>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
边栏推荐
- Implementation of AVL tree
- MySQL service is missing from computer service
- Composition API 前提
- Abnova membrane protein lipoprotein technology and category display
- leetcode 509. Fibonacci number
- A slow SQL drags the whole system down
- Role of virtual machine
- Communication of components
- Please answer the questions about database data transfer
- Lvs+kept (DR mode) learning notes
猜你喜欢
Flexible layout (II)
JDBC database connection pool usage problem
Use of completable future
Big coffee gathering | nextarch foundation cloud development meetup is coming
How to model and simulate the target robot [mathematical / control significance]
Circulating tumor cells - here comes abnova's solution
Nesting and splitting of components
LC 面试题 02.07. 链表相交 & LC142. 环形链表II
大咖云集|NextArch基金会云开发Meetup来啦
Config distributed configuration center
随机推荐
IP address
How Oracle backs up indexes
详解机器翻译任务中的BLEU
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
linux系统rpm方式安装的mysql启动失败
Abnova immunohistochemical service solution
Select the product attribute pop-up box to pop up the animation effect from the bottom
Procedure in PostgreSQL supports transaction syntax (instance & Analysis)
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
JS decorator @decorator learning notes
"Xiaodeng in operation and maintenance" meets the compliance requirements of gdpr
.net core 访问不常见的静态文件类型(MIME 类型)
Bindingexception exception (error reporting) processing
Freeswitch dials extension number source code tracking
Advantages of using net core / why
JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
How to model and simulate the target robot [mathematical / control significance]
The currently released SKU (sales specification) information contains words that are suspected to have nothing to do with baby
OOM(内存溢出)造成原因及解决方案
MySQL binlog related commands