求救!!!!!!!求输入一组数中的负数个数,编译没错,可是当输入一组数字按回车键后光标换行了啊。没有预想的效果。
侯雅文 2013-05-18 02:35:25 #include <iostream>
using namespace std;
int main()
{ int amount=0,value;
while(cin>>value)
if(value<=0)
++amount;
cout<<"Amount of all negative values read is"
<<amount<<endl;
return 0;
}