001package algs31; 002import stdlib.*; 003import algs35.ST; 004 005public class XCount { 006 007 public static void main(String[] args) 008 { 009 ST<String, Integer> st = new ST<>(); 010 for (int i = 0; !StdIn.isEmpty(); i++) 011 { 012 String key = StdIn.readString(); 013 st.put(key, i); 014 } 015 for (String s : st.keys()) 016 StdOut.println(s + " " + st.get(s)); 017 } 018}