📅  最后修改于: 2022-03-11 14:44:58.655000             🧑  作者: Mango
int x;
cout << "hurry, give me a number!: "; // Type a number and press enter
cin >> x; // Get user input from the keyboard
cout << "you picked: " << x << " !" // Display the input value
OR use:
getline >> (cin, variable-name);
instead of
cin >> x;