fork download
  1. public class Main{
  2. public static void main(String[] args){
  3. int[ ] n = {1,2,3,4,5,6,7,8};
  4. int total =0;
  5. for(int i : n )
  6. total += i;
  7. System.out.print(total / n.length);
  8. }
  9. }
  10.  
  11.  
Success #stdin #stdout 0.02s 245632KB
stdin
Standard input is empty
stdout
4