码迷,mamicode.com
首页 > 编程语言 > 详细

Problem Z: 零起点学算法22——求正弦和余弦

时间:2018-10-04 20:31:52      阅读:544      评论:0      收藏:0      [点我收藏+]

标签:const   scanf   ons   nbsp   main   ble   clu   can   color   

#include<stdio.h>
#include <math.h>
int main()
{
    int n;
    const double pi=acos(-1); 
    double a,b;
    while(scanf("%d",&n)!=EOF)
    a=sin(n*pi/180);
    b=cos(n*pi/180);
    printf("%.2f\n%.2f\n",a,b);
    return 0;
}

 

Problem Z: 零起点学算法22——求正弦和余弦

标签:const   scanf   ons   nbsp   main   ble   clu   can   color   

原文地址:https://www.cnblogs.com/chenlong991223/p/9743214.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!