fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int number = -1;
  6. cout << "Enter a number: ";
  7. if (cin >> number)
  8. {
  9. cout << number << " that's a number!" << endl;
  10. }
  11. else
  12. {
  13. cout << "Not a number!" << endl;
  14. }
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3300KB
stdin
ajshdkajshds7
stdout
Enter a number: Not a number!