当前位置:网站首页>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
边栏推荐
- $parent(获取父组件) 和 $root(获取根组件)
- At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
- Matlab tips (29) polynomial fitting plotfit
- Circulating tumor cells - here comes abnova's solution
- ViewModelProvider. Of obsolete solution
- About binary cannot express decimals accurately
- Esxi attaching mobile (Mechanical) hard disk detailed tutorial
- Use of completable future
- 关于二进制无法精确表示小数
- Role of virtual machine
猜你喜欢
AVL树的实现
Role of virtual machine
After the promotion, sales volume and flow are both. Is it really easy to relax?
Matlab tips (30) nonlinear fitting lsqcurefit
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
How can gyms improve their competitiveness?
sql中对集合进行非空校验
This article introduces you to the characteristics, purposes and basic function examples of static routing
Config distributed configuration center
关于数据库数据转移的问题,求各位解答下
随机推荐
transform-origin属性详解
[noi simulation] regional division (conclusion, structure)
FullGC问题分析及解决办法总结
計算機服務中缺失MySQL服務
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
Several important steps to light up the display
Unity3d learning notes
linux系统rpm方式安装的mysql启动失败
Apache AB stress test
Freeswitch dials extension number source code tracking
$refs:组件中获取元素对象或者子组件实例:
sql中对集合进行非空校验
Hidden Markov model (HMM) learning notes
Tumor immunotherapy research prosci Lag3 antibody solution
FPGA course: application scenario of jesd204b (dry goods sharing)
Lvs+kept (DR mode) learning notes
Multidisciplinary integration
Config distributed configuration center
Sqlserver multithreaded query problem
How Oracle backs up indexes