輸入輸出要用到這個.
標准C++庫的所有的標識符都是在一個名為std的命名空間中定義的,或者說標准頭文件(如iostream)中函數、類、對象和類模板是在命名空間 std中定義的。std是standard(標准)的縮寫,表示這是存放標准庫的有關內容的命名空間。
二元作用域分辨運算符::
using std::cout;
using std::cin;
using std::endl;
1、std::cout<<”OK.”
2、using namespace std;
cout<<”OK.”
3、using std::cout;
cout<<”OK.”
【參考】
C++命名空間 namespace的作用和使用解析 - 莫水千流 - 博客園 https://www.cnblogs.com/zhoug2020/p/5972439.html
C++的命名空間的使用 - 王會喜 - 博客園 https://www.cnblogs.com/wanghuixi/p/6887390.html