当前位置:网站首页>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次幂。
边栏推荐
猜你喜欢

Go unit test

RT thread add MSH command

构建信创产业生态,移动云立足全栈自主创新连放大招

搭建一个QQ机器人叫女友起床

I have been promoted. How can I get along with my former colleagues at the same level?

几款实用软件分享

Three implementation methods of distributed lock

必须知道的RPC内核细节(值得收藏)!!!

What is a good quick development framework like?

STM32F1与STM32CubeIDE编程实例-红外寻迹传感器驱动
随机推荐
EasyCVR使用RTMP推流时不显示界面如何解决?
Spring recruitment interview experience summary (technical post)
Build a security video monitoring platform using Huawei cloud ECS server
Dr. Sun Jian was commemorated at the CVPR conference. The best student thesis was awarded to Tongji Ali. Lifeifei won the huangxutao Memorial Award
解决预览pdf不能下载的问题
Install using snap in opencloudos NET 6
oracle中遇到的bug
云原生数据库-Amazon RDS
What is JSX in the JS tutorial? Why do we need it?
sql根据比较日期新建字段
Golang 快速上手 (3)
Personal blog system graduation project opening report
Go string comparison
文件IO(1)
2021-05-07构造器
高性能算力中心 — NVMe/NVMe-oF — NVMe-oF Overview
Is there anyone who plans to open source an industrial "seckill" system architecture?
2021-05-11instanceof和类型转换
XML related interview questions
2021-04-16递归