题解 | #2的n次方计算#
2的n次方计算
http://www.nowcoder.com/practice/35a1e8b18658411388bc1672439de1d9
#include<stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
printf("%d",1<<n);//注意n的范围是从0-31
return 0;
}
2的n次方计算
http://www.nowcoder.com/practice/35a1e8b18658411388bc1672439de1d9
#include<stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
printf("%d",1<<n);//注意n的范围是从0-31
return 0;
}
相关推荐