已知 ,其中,sh为双曲正弦函数,即。编写一个程序,输入x的值,求y的值。
#include<iostream> #include<cmath> using namespace std; double sh( double t ); int main() { double x,y; cout << "x="; cin >> x; y = sh( 1+sh(x) )/( sh( 2*x )+sh( 3*x ) ); cout << "y=" << y << endl; } double sh( double t ) { return ( exp( t )-exp( -t ) )/2; }
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题