fork download
  1. #!/bin/bash
  2. read n
  3. sum=0
  4. for ((i=0;i<$n;i++))
  5. do
  6. read temp
  7. sum=$(($sum+$temp))
  8. done
  9. printf "%.3f\n" `$(bc -l <<< "$`sum/$n")
  10. # your code goes here
Runtime error #stdin #stdout #stderr 0s 19632KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog.sh: line 4: ((: i<: syntax error: operand expected (error token is "<")
./prog.sh: line 9: unexpected EOF while looking for matching `"'
./prog.sh: line 11: syntax error: unexpected end of file