我有一个相当大的应用程序,我没有std命名空间工作,我注意到我没有包括std :: cos或std :: sin但我得到了正确的结果.为什么?
一些减少代码的示例是:
#include <ctime>
#include <cmath>
#include <iostream>
#include <vector>
//#include <unistd.h>
#include <fstream>
#include <sstream>
#include <iomanip>
using std::cout;
using std::endl;
int main()
{
double pi = 4*(atan(1));
cout << "pi = " << pi << endl
<< "cos(pi) = " << cos(pi) << endl
<< "sin(pi) = " << sin(pi) << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我已将所有标题保留在其中,我在主代码中使用它们.输出按预期返回~3.14,-1和1e-16.为什么这样做?cos和罪是在std不是吗?
我在远程unix服务器上使用g ++编译器
谢谢
因此,网站的完整 URL 为 http://www.google.com:80 或https://www.google.com:443(因为每个人都应该使用 SSL)。
http 位、www 位和 :80 位本质上都表示相同的内容。超过80的流量通常是http流量,www似乎也是多余的。
那么,为什么一个 URL 会有这么多冗余元素呢?或者说,我到底误会了什么。