当前位置:网站首页>[C language] power table of 3 generated by PTA 7-53
[C language] power table of 3 generated by PTA 7-53
2022-07-29 04:29:00 【LastWhisperw】
Enter a non negative integer n, Generate one 3 The power table of , Output 3^0~3^n Value . Power function calculation can be called 3 Power of .
Input format :
The input gives a nonnegative integer on one line n.
Output format :
Output in ascending order of power n+1 That's ok , The format of each line is “pow(3,i) = 3 Of i The value of the power ”. Ensure that the output data does not exceed the range of long integers .
sample input :
3
No blank lines at the end
sample output :
pow(3,0) = 1
pow(3,1) = 3
pow(3,2) = 9
pow(3,3) = 27
No blank lines at the end
pow(a,b) Is to seek a^b Function of . To use this function, you need to include math.h This header file
#include<stdio.h>
#include<math.h>
int main(){
int n;
scanf("%d",&n) ;
int i;
for(i=0;i<=n;i++){
int a=pow(3,i);
printf("pow(3,%d) = %d\n",i,a);
}
return 0;
}
边栏推荐
- 12.优先级队列和惰性队列
- 不会就坚持63天吧 最大的异或
- What is the difference between field, variable and property
- Niuke IOI weekly 27 popularity group
- MySQL - clustered index and secondary index
- Not for 58 days. Implement prefix tree
- 11. Backup switch
- Pytoch distributed training
- [material delivery UAV] record (ROS + Px4 + yolov5 + esp8266 + steering gear)
- Openfeign asynchronous call problem
猜你喜欢
There are objections and puzzles about joinpoint in afterreturning notice (I hope someone will leave a message)
Don't insist on 66 days. Weight generates random numbers
Won't you just stick to 62 days? Sum of words
不会就坚持60天吧 神奇的字典
Realize the effect of univariate quadratic equation through JS. Enter the coefficients of a, B and C to calculate the values of X1 and x2
使用容器部署Jenkins
Class starts! See how smardaten decomposes complex business scenarios
Hengxing Ketong invites you to the 24th China expressway informatization conference and technical product exhibition in Hunan
On quotation
Basic operation of queue
随机推荐
Code or script to speed up the video playback of video websites
Deep learning training strategy -- warming up the learning rate
Labelme cannot open the picture
10.回退消息
不会就坚持66天吧 权重生成随机数
Not 67 days, square root
Introduction and examples of parameters in Jenkins parametric construction
Mongo shell interactive command window
String, array, generalized table (detailed)
SQL time fuzzy query datediff() function
redux快速上手
9. Delay queue
VScode 一键编译和调试
Use of torch.optim optimizer in pytorch
Pytoch distributed training
C语言力扣第61题之旋转链表。双端队列与构造循环链表
你真的会写Restful API吗?
Star a pathfinding in LAYA
Leetcode 686. KMP method of repeatedly superimposing strings (implemented in C language)
Pix2.4.8 from start to installation (2021.4.4)