当前位置:网站首页>[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 :
3No blank lines at the end
sample output :
pow(3,0) = 1
pow(3,1) = 3
pow(3,2) = 9
pow(3,3) = 27No 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;
}边栏推荐
- openFeign异步调用问题
- C language: typedef knowledge points summary
- Vscode one click compilation and debugging
- Pytorch GPU and CPU models load each other
- Exception resolution: error of not finding edu.stanford.nlp.semgraph.semgrex.semgrexpattern in cococaption package
- Hengxing Ketong invites you to the 24th China expressway informatization conference and technical product exhibition in Hunan
- Pytoch automatic mixing accuracy (AMP) training
- oracle 更新和删除数据
- C language: summary of consortium knowledge points
- Coding questions encountered in the interview
猜你喜欢
随机推荐
Mongo shell interactive command window
Installation and use of stm32cubemx (5.3.0)
Log configuration logback
Differences and principles of bio, NiO and AIO
oracle 更新和删除数据
[express connection to MySQL database]
Flutter实战-请求封装(二)之dio
Multi rotor six axis hardware selection
Don't stick to it for 68 days. Baboons eat bananas
The third ACM program design competition of Wuhan University of Engineering
Pytorch fixed random seed & recurrence model
Openfeign asynchronous call problem
Won't you insist on 71 days? List sorting
The principle of inverse Fourier transform (IFFT) in signal processing
不会就坚持61天吧 最短的单词编码
Wechat applet parameter transfer
post导出数据,返回
恒星科通邀您“湘”约第24届中国高速公路信息化大会暨技术产品展示会
Record the Niua packaging deployment project
【Express连接MySQL数据库】









