When the program is compiled, all pre-processing commands are processed, replacing the specific contents of the header file with the # include command line, and then compiling the program unit as a whole.
using namespace Std; "Use command space Std".
Classes and functions in the C + + standard library are declared in the namespace STD, so if you need to use the C + + standard library in your program (you need to use the # include command line at this point)
The sum of the numbers of a and b,2?????????????
Sum of 2 numbers
#include <iostream> //preprocessing naming
using namespace std; //Using the namespace std
int main () //main functions First
{ //Start part of the main function
int a,b,sum;//define variables
cin >> a>>b; //Input statement, cin input Stream object ">>" is the extract operator, which is used in conjunction with CIN
//role: Extracting data from input devices such as keyboards is sent to the input stream cin.
/*
their combination abbreviation: CIN statement. When executing the CIN statement in the program, a data input from the keyboard
assigned to integer variable A, the second data entered is assigned to integer variable B.
*/
Sum=a+b; Assignment statements
cout<< "a+b=" <<sum<<endl; Output statement, Endl is a control, action is a newline (end line abbreviation, indicating the end of the bank)
return 0; Returns a value of 0 to the operating system if the program ends normally
/*
123 456
Result of output: a+b=579
*/
}
Understanding of C + + program compilation process