三程序代码#include#include#defineepseusingnamespacestddoublef(doublex){returnsqrt(cos(x)*cos(x))}被积函数doubleSn(doublea,doubleb,doublen){doubleh=(ab)(*n)doublesum=for(intk=k<=nk){sum=*f(a(*k)*h)sum=f(a*k*h)}sum=(sum*f(a)f(b))*hreturnsum}辛普森公式doubleSolve(doublea,doubleb){inti=doubleSn=Sn(a,b,i)doubleSn=Sn(a,b,*i)while(fabs(SnSn)>eps){cout<<"n="<