Std::cout is an object in the Ostream type in the #include<iostream> library
STD:: Represents a namespace, all names defined by the standard library are in the namespace Std
Std::cout is an object in the IStream type in the #include<iostream> library
std::cout<<a<<std::endl;
The << in the previous statement is the input operator, which is to get the amount of the head over there into the object referred to by the arrow and return the object that the arrow after the operation refers to.
Std::endl is a manipulator that ends the current line and brushes the contents of the buffer associated with the device to the device, preferably with a endl for each cout to clear the cache.
std::cin>>a>>b;
In Cin, when an invalid input is encountered, such as CIN>>V1>>V2,V1 is int, you enter a, it returns an invalid state, and the subsequent V2 cannot be entered. Or when a file terminator is encountered, an invalid state is returned.
End of file in Window System by CTRL + Z type, Linux by Ctrl+d type
The above features can be used to read a variable amount of input data.
#include <iostream>using namespace Std;int main () {int sum = 0, value = 0;while (cin >> value) {sum + = value;} cout << Sum<<endl;return 0;}
PS: annotations cannot be nested
C + + cout<< cin>> Comment