import java.util.Scanner; /* * input: 5 hey hi Mark hi mark * output: * hey 1 * hi 2 * Mark 1 * hi 2 * mark 1 * * assume input will always be less than 20 words * hint: Use two arrays, one array for strings * one array for frequencies */ public class wordFreq { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String[] words = new String[20]; int[] frequencies = new int[20]; int numberOfWords = scnr.nextInt(); for (int i=0; i