📄 ch03.02.c
字号:
// #include <iostream>
#include <iostream.h>
/**
** 2 raised to the power of 10: 1024
**/
int main()
{
int value = 2;
int pow = 10;
cout << value << " raised to the power of "
<< pow << ": \t";
int res = 1;
// loop control statement:
// repeat calculation of res
// until cnt is greater than pow
for ( int cnt=1; cnt <= pow; ++cnt )
res = res * value;
cout << res << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -