Title Description
Write a function to find the value of Sinh (x), the approximate formula for Sinh (x) is Sinh (x) = (ex-e-X)/2, where a function is used to find the ex . The result retains two decimal places.
Input
X
Output
The value of the Sinh (x).
Sample input
1
Sample output
1.18
Tips
The main function is given below, and it is not required to include the following main function when committing
/* C code */
int main () {
Double X;
scanf ("%lf", &x);
printf ("%.2f\n", Udf_sinh (x));
return 0;
}
/* C + + code */
int main () {
Double X;
cin>>x;
Cout<<setiosflags (ios::fixed);
Cout<<setprecision (2);
Cout<<udf_sinh (x) <<endl;
return 0;
}
The code is as follows:
#include <iostream> #include <iomanip> #include <cmath>using namespace std;double Udf_sinh (double n) { Double Sinh; Sinh= (exp (n)-exp (-N))/2; return sinh;} int main () {double x;cin>>x;cout<<setiosflags (ios::fixed); cout<<setprecision (2); cout<<udf _sinh (x) <<endl;return 0;}
Operation Result:
OJ Brush question "seeking Sinh (x)"