⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soln5_3.cpp

📁 Wrox.Ivor.Hortons.Beginning.Visual.C.Plus.Plus.2008 With sourcecode
💻 CPP
字号:
// Soln5_3.cpp
#include <iostream>
#include <cmath>
using std::cout;
using std::endl;
using std::sin;
using std::cos;
using std::tan;

const double DEG_TO_RAD = 57.2957795;

double sind(double d)
{
   return sin(d/DEG_TO_RAD);
}

double cosd(double d)
{
   return cos(d/DEG_TO_RAD);
}

double tand(double d)
{
   return tan(d/DEG_TO_RAD);
}

int main()
{
   cout << "cos(30) = " << cosd(30.0) << endl;
   cout << "sin(30) = " << sind(30.0) << endl;
   cout << "tan(30) = " << tand(30.0) << endl;

   return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -