📄 hcx1.cpp
字号:
// hcx1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <math.h>
void main()
{double k,s,r;
double tsin(double x);
cout<<"r=";
cin>>r;
cout<<"s=";
cin>>s;
if(r*r<=s*s)
k=sqrt(tsin(r)*tsin(r)+tsin(s)*tsin(s));
else
k=tsin(r*s)/2;
cout<<k<<endl;
}
double tsin(double x)
{double p=0.000001,g=0,t=x;
int n=1;
do{
g=g+t;
n++;
t=-t*x*x/(2*n-1)/(2*n-2);
}while(fabs(t)>=p);
return g;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -