#include <iostream> using namespace std; int main(){ float a[6]; int x = 0; // 记得赋值,否则会读取脏数据 for (int i = 0 ; i < 6; i ++){ cin >> a[i]; if (a[i] > 0) x++; } cout << x << " positive numbers"; return 0; }