📄 2x.cpp
字号:
// Generate a table of powers of the values 1 to 5
#include <iostream.h>
void main()
{ float N, count, power;
cout << "table of powers" << endl;
cout << " N 2 3 4 5 6" << endl;
N = 1.0;
while (N <= 5.0)
{ count = 0.0;
power = 1.0;
while (count < 6.0)
{ power = power * N;
count = count+1.0;
cout << " " << power;
} // end of (count < 6) loop
cout << endl;
N = N + 1.0;
} // end of (N<=5) loop
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -