fork download
  1. (defpackage "ODAI-PT15-504" (:use "COMMON-LISP"))
  2. (in-package "ODAI-PT15-504")
  3.  
  4. (loop with h = (make-hash-table :test #'equal)
  5. for s = (read-line nil nil)
  6. while s
  7. do (incf (gethash s h 0))
  8. finally (maphash (lambda (k v) (format t "~A ~A~%" k v)) h))
  9.  
Success #stdin #stdout 0.01s 25564KB
stdin
Hoge
Fuga
Foo
Fuga
Foo
Hoge
Bar
Fuga
Piyo🐤
Piyo🐤
stdout
Hoge 2
Fuga 3
Foo 2
Bar 1
Piyo🐤 2