《C++primer》习题练习:
1.17 输入一组数,计算并输出其中负数的个数
#include<iostream>
int main()
{
int amount=0,value;
while(std::cin>>value)
{
if(value<0)
++amount;
}
std::cout<<"Amount of all negative values is "<<amount<<std::endl;
system("pause");
return 0;
}