Restrict user to input real number only in C++

前端 未结 10 1915
旧时难觅i
旧时难觅i 2021-01-15 06:40

How can I restrict the user to input real numbers only in C++ program?

Example:

double number; cin >> number;

and it won\'t accept t

10条回答
提交回复
热议问题