1117:0 start-up algorithm 24--sine and cosine

Source: Internet
Author: User

1117:0 start-up algorithm 24--sine and cosine time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:3131 accepted:1485
[Submit] [Status] [Web Board] Description

Enter a positive integer n to output the sine and cosine function values of n degrees.

Input Enter a positive integer (not greater than 10000) (multiple sets of data)

Output

The sine and cosine function values of n degrees are output by 2 lines respectively, and 2 decimal places are reserved.

Sample Input
90

Sample Output
1.000.00

HINT

Note that the normal cosine function is called, and the function parameter is radians, which is to be added #include<math.h>.


Source

0 Starting point Learning algorithm

1#include <stdio.h>2#include <math.h>3 Const DoublePi=acos (-1);4 intMain () {5     intN;6      while(SCANF ("%d", &n)! =EOF) {7         Doublem=n*pi/ the;8printf"%.2f\n%.2f\n", Sin (m), cos (m));9     }Ten     return 0; One}

1117:0 start-up algorithm 24--sine and cosine

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.