Problem : 2008 ( 数值统计 ) Judge Status : Accepted
RunId : 5995765 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
RunId : 5995765 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h> 2 #include <math.h> 3 int cnt[3]; 4 int main() 5 { 6 int n,t; 7 double m; 8 while (scanf("%d",&n),n) 9 { 10 cnt[0]=cnt[1]=cnt[2]=0; 11 while(n--) 12 { 13 scanf("%lf",&m); 14 if(m==0) 15 { 16 cnt[1]++; 17 } 18 else 19 { 20 t=m/fabs(m); 21 cnt[t+1]++; 22 } 23 } 24 printf("%d %d %d\n",cnt[0],cnt[1],cnt[2]); 25 } 26 return 0; 27 }