【求助】如何实现这个简单功能
书上只要输入4个数就可以了,但是我实际写程序输入了数之后还必须输入一个非数字符才可以跳出循环

#include <iostream> #include <stdio.h> int main() { int i=0,sum=0; while (std::cin >> i) { sum += i; } std::cout << sum <<std::endl; system("pause"); return 0; }
请问是IDE的问题吗?我用的vs2015