判断输入的数中正数的个数

#include<iostream>
using namespace std;
int main()
{
    
    
int x,s=0;
cin >> x;
while(x!=0){
    
    
if(x>0)
s++;
cin >> x;}
cout << s << endl;
return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_51082388/article/details/112101670