C++ Example - Standard Input/Output

C++ Examples

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 entered number is:" << number; return 0; }

The output of the above program execution is:

输入一个整数: 12
输入的数字为: 12

C++ Examples

other extensions