1. /*
    2. * Time: 202-1-15
    3. * Author: Fei Dongxu <Phil616@163.com>
    4. */
    5. #include <iostream>
    6. using namespace std;
    7. int main(){
    8. cin << "Hello World!" << endl;
    9. return 0;
    10. }
    11. //This is a standard C++ program which can print a string "Hello World!" with a new line
    12. //to console window
    1. // is a single line annotation
    2. /*
    3. are a pair of block annotation.
    4. All the content in side are annotations
    5. */
    6. using namespace std;
    7. //this is a convenient way to simply the std::cin
    8. otherwise the program will look like this:

    unconvinient way:

    1. #include <iostream>
    2. int main(){
    3. std::cin << "Hello World!" << std::endl;
    4. return 0;
    5. }

    With MinGw or gcc/g++ compiler

    1. g++ <FILENAME> -o <TARGETNAME>
    2. for example:
    3. g++ hello.cpp -o hello.exe