int sum=age1+age2+age3+age4;
double avg=sum/4;
int minus=age2-ag1;
int newAge=--age1;
你这么写可以加个绝对值
Math.abs(minus);
int minus=age1-age2;
你写反了