问题:不使用累计乘法的基础上
通过移位运算( << )实现2的n次方的计算
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//不使用累计乘法的基础上
//通过移位运算( << )实现2的n次方的计算
int main()
{
int num = 1;
int n = 0;
scanf("%d", &n);//输入n次方
num = num << n;
printf("%d", num);
return 0;
}
运行结果: