fork download
  1. # compute average line length
  2. var count = 0
  3. var sum = 0
  4.  
  5. for line in stdin.lines:
  6. count += 1
  7. sum += line.len
  8.  
  9. echo "Average line length: ",
  10. if count > 0: sum / count else: 0# your code goes here
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.nim(6, 10) Error: undeclared identifier: '+='
stdout
Standard output is empty