#include<iostream> //#include<cmath> using namespace std; int main() { int n,c1,c2,c3; double x; while( cin >> n && n != 0) { c1 = c2 = c3 = 0; for( int i = 0;i < n;i ++) { cin >> x; if( x < 0) { c1 ++; } else if(x > 0) { c3 ++; } else c2 ++; } cout << c1 <<" " << c2 <<" " << c3 << endl; } system("pause"); }
转载于:https://www.cnblogs.com/hibernate3-example/archive/2011/11/14/2492752.html