C++ Example - Standard I/O
Use C++ to get user input and output it to the screen:
Example
include
<
iostream
using
namespace
std;
int
main
(
)
{
int
number
;
cout
<<
"
Enter an integer:
"
;
cin
number
;
cout
<<
"
The number entered is:
"
<<
number
;
return
0
;
}
The output of the above program is:
输入一个整数: 12
输入的数字为: 12
C++ Example