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