数值统计
#include<stdio.h> int main( ) { int N; while(scanf("%d",&N)!=EOF,N) { int i,n=0,m=0,p=0; double t; for(i=1;i<=N;i++) { scanf("%lf",&t); if(t<0) n++; else if(t==0) m++; else p++; } printf("%d %d %d\n",n,m,p); } return 0; }
posted on 2011-04-28 12:24 more think, more gains 阅读(150) 评论(0) 编辑 收藏 举报