C++ 学习笔记
很基础的东西, 我表示也还是需要记录下的。
1.pow 指数函数(x的y次方)
#include <math.h>
2.sin sin函数
3.在c++中这很容易:
if(typeid(exp)==typeid(int))
{ //you statement;...
}
//typeid 是c++关键字用来判断某一表达式与
//另一表达式是否有相同的类型(记住了:))
4.substr(0,8)
5.牛顿法
迭代公式:x(n+1)=x(n)-f(x(n))/f'(x(n))
6.abs() 绝对值
7.#define N 20 预定义
8.//判断num是否完全平方数
int isSqure(int n)
{
double fsqrt = sqrt(n);
int m = fsqrt;
return m*m == n;
}