当前位置:网站首页>NOI OJ 1.3 20:计算2的幂 C语言
NOI OJ 1.3 20:计算2的幂 C语言
2022-06-23 10:12:00 【chd44】
描述
给定非负整数n,求2n。
输入
一个整数n。0 <= n < 31。
输出
一个整数,即2的n次方。
因为要求2的n次方,所以此处我们引进pow(),引用pow()需要使用#include<math.h>。
#include<stdio.h>
#include<math.h>
int main(){
int a;
scanf("%d",&a);
int b=pow(2,a);
printf("%d",b);
return 0;
}注:pow(x,y) 计算x的y次幂。
边栏推荐
- 同花顺推荐么?手机开户安全么?
- SQL教程之SQL 中数据透视表的不同方法
- Successful experience of postgraduate entrance examination in materials and Chemical Engineering (metal) of Beijing University of Aeronautics and Astronautics in 2023
- 高性能算力中心 — NVMe/NVMe-oF — NVMe-oF Overview
- 解决audio自动播放无效问题
- JVM简单入门-01
- 2021-05-10 method rewrite polymorphism considerations
- 135137138445 unable to remotely connect to the database due to disabling
- mysql中innodb下的redo log什么时候开始执行check point落盘的?
- MySQL基础-笔记
猜你喜欢

Lying trough, the most amazing paper artifact!

马斯克 18 岁儿子请愿改名,欲断绝父子关系

Unity技术手册 - 生命周期内速度限制(Limit Velocity Over Lifetime)子模块和速度继承(Inherit Velocity)子模块

谷贱伤农,薪贱伤码农!

Unity技术手册 - 生命周期LifetimebyEmitterSpeed-周期内颜色ColorOverLifetime-速度颜色ColorBySpeed

Mathematical analysis_ Notes_ Chapter 2: real and plural numbers

Cloud native database Amazon RDS

XML related interview questions

利用华为云ECS服务器搭建安防视频监控平台

ICLR 2022 | dynamic convolution tadaconv in video and efficient convolution video understanding model tadaconvnext
随机推荐
Build a security video monitoring platform using Huawei cloud ECS server
JS教程之 什么是 JSX?为什么我们需要它?
STM32F1与STM32CubeIDE编程实例-红外寻迹传感器驱动
快速排序的简单理解
After the uncommitted transactions in the redo log buffer of MySQL InnoDB are persisted to the redo log, what happens if the transaction rollback occurs? How does the redo log handle this transaction
Spring recruitment interview experience summary (technical post)
2021-04-27 classes and objects
Go string comparison
Golang 快速上手 (3)
验证码redis实践总结
Successful experience in postgraduate entrance examination for MTI master of English translation major of Beijing University of science and technology in 2023
高性能算力中心 — NVMe/NVMe-oF — NVMe-oF Overview
利用华为云ECS服务器搭建安防视频监控平台
解决预览pdf不能下载的问题
【第23天】给定一个长度为 n 的数组,将元素 X 插入数组指定的位置 | 数组插入操作4
Lu Qi invests in quantum computing for the first time
2022高考季征文获奖名单公布
Build the information and innovation industry ecology, and make mobile cloud based on the whole stack of independent innovation
安装typescript环境并开启VSCode自动监视编译ts文件为js文件
炫酷相册代码,祝对象生日快乐!