引入系统函数 #include <cmath>
例: 求输入角度的三角函数值
#include <iostream>
#include <cmath>
using namespace std;
const double PI = 3.1415;
int main(){
double angle;
cout << "please enter an angle:";
cin >> angle;
double radian = angle * PI / 180;
cout << "sin(" << angle << ")=" << sin(radian) << endl;
cout << "cos(" << angle << ")=" << cos(radian) << endl;
return 0;
}