首先要在所在的cpp文件中添加include语句 #include <math.h> 程序实现如下: double pi = 3.1415926535; a=sin(angle*pi/180); a即为所求