64,642
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
int main()
{
int amount=0,value;
while(std::cin>>value)
{
if(value<=0)
{
++amount;
}
}
std::cout<<amount<<std::endl;
return 0;
}
我写的代码应该没问题,但是在DOS框中的时候,我输入了数字之后,按回车键,却没有出现结果,就是往下跳一行,一直往下跳。
#include <iostream>
int main()
{
int amount=0,value;
while(std::cin>>value)
{
if(value<=0)
{
++amount;
}
}
std::cout<<amount<<std::endl;
system("pause");
return 0;
}