📄 tst_power.cc
字号:
#include <iostream> // input output operations#include <cmath> // mathematics libraryusing namespace std; // the above is part of the standard namespacedouble power(double x, double n){ // define a simple power function double p = exp(n*log(x)); return p;};int main(){ for (int n=1;n<6;n++){ cout << " 2^" << n << " = " << power(2,n) << endl; };};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -