我算投机取巧吗?
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
double add = 0;//正整数合
int fu = 0;//负数个数
int count = s.nextInt();
int all = 0;
while (count > 0){
int i = s.nextInt();
if (i < 0){
fu++;
}else {
if (i != 0){
all++;
}
add += i;
}
count--;
}
if (all == 0){
System.out.println(fu+" "+"0.0");
}else{
System.out.println(fu+" "+String.format("%.1f",add/all));
}
}
}