OJ Brush question "seeking Sinh (x)"

Source: Internet
Author: User

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)"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.