Skip to content

Instantly share code, notes, and snippets.

@kunishi
Last active October 24, 2017 06:53
Show Gist options
  • Save kunishi/124e55fc657cfe7d03de to your computer and use it in GitHub Desktop.
Save kunishi/124e55fc657cfe7d03de to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
chars = words = lines = 0
while line = gets
chars += line.length
words += line.split.length
lines += 1
end
print chars, ", ", words, ", ", lines, "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment