题解 | #记负均正#
记负均正
http://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8
int main() { int n = 0; while (~scanf("%d", &n)) { int tmp = 0; int sum = 0; int c = 0; int i = n; float n1 = (float)n; while (i) { scanf("%d",&tmp); if (tmp < 0) { c++; n1--; } else if (tmp == 0) n1--; else { sum += tmp; } i--; } printf("%d %.1f\n", c, sum / n1); } return 0; }