数组版:
#include<bits/stdc++.h> using namespace std; int main(){ int x=0; double a[7]; for(int i=1;i<=6;i++){ cin>>a[i]; if(a[i]>=0)x++; } cout<<x<<" positive numbers"; }