level 12
441932250
楼主
//读入一组数据,直到读入结束符(Ctrl+z), 得出负数的个数。
#include<iostream>
using namespace std;
int main()
{
cout<<"Please input a list number:"<<endl;
int amount=0,value;
while(cin>>value)
if(value<0)
++amount;
cout<<"fushu de ge shu is "<<amount<<endl;
//cin.get(); 解决不了闪退问题。
return 0;
}
//我用的编辑器是VS2012,一般程序闪退,加cin.get(),就可以。可是这个加了也不行。大家有没有什么好办法?
2014年01月11日 13点01分
1
#include<iostream>
using namespace std;
int main()
{
cout<<"Please input a list number:"<<endl;
int amount=0,value;
while(cin>>value)
if(value<0)
++amount;
cout<<"fushu de ge shu is "<<amount<<endl;
//cin.get(); 解决不了闪退问题。
return 0;
}
//我用的编辑器是VS2012,一般程序闪退,加cin.get(),就可以。可是这个加了也不行。大家有没有什么好办法?