using namespace std を使うか、std:: を常に指定する。 † using namespace std を指定する場合 #include <iostream> using namespace std; void hello() { cout << "Hello, world" << endl; } std:: を常に指定する場合 #include <iostream> void hello() { std::cout << "Hello, world" << std::endl; } ↑ 改行は endl を使う。 † C の場合 #include <stdio.h> void hello() { printf("Hello, world\n"); } C++ の場合 #include <iostream> using namespace std; void hello