时间限制:CC++ 1000MS其他语言 2000MS内存限制:CC++ 256MB其他语言 512MB难度:中等出题人:描述给定非负整数n求2 n 的值即2的n次方。输入描述一个整数n。0≤n31。输出描述一个整数即2的n次方。
#include
int main() { int n; cin >> n;
int result = 1;
for (int i = 0; i < n; i++) {
result *= 2;
}
cout << result << endl;
return 0;
}
原文地址: https://www.cveoy.top/t/topic/iAWv 著作权归作者所有。请勿转载和采集!