About cin (may later be repaired)

In memory of. If you want to output variable of type int or double, cin actually automatically stopped in front of the character type, quite scanf style. For example, the following code:

#include <iostream>
using namespace std;
int main() {
	double x;
	cin >> x;
	cout << x;
	return 0;
}

Input 12.0abcdefg, 12 is output.
Cried ......

Guess you like

Origin blog.csdn.net/weixin_44288817/article/details/90300743
May