/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kawakami.pe.problem17;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author 
 */
public class Problem17 {
    // 1 - 9 one, two, three, four, five, six, seven, eight, nine
    // 10,11,12 ten, eleven, twelve
    // 13 - 19 thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen
    // 20 twenty
    // 30 thirty
    // 40 forty
    // 50 fifty
    // 60 sixty
    // 70 seventy
    // 80 eighty
    // 90 ninety
    // 100 one hundred
    
    public static void main(String[] args) {
        Map<Integer, String> m1 = new HashMap<>();
        m1.put(1, "one");m1.put(2, "two");m1.put(3, "three");
        m1.put(4, "four");m1.put(5, "five");m1.put(6, "six");
        m1.put(7, "seven");m1.put(8, "eight");m1.put(9, "nine");
        
        Map<Integer, String> m2 = new HashMap<>();
        m2.put(10, "ten");m2.put(11, "eleven");m2.put(12, "twelve");
        m2.put(13, "thirteen");m2.put(14, "fourteen");m2.put(15, "fifteen");
        m2.put(16, "sixteen");m2.put(17, "seventeen");m2.put(18, "eighteen");
        m2.put(19, "nineteen");
        
        Map<Integer, String> m3 = new HashMap<>();
        m3.put(20, "twenty");m3.put(30, "thirty");m3.put(40, "forty");
        m3.put(50, "fifty");m3.put(60, "sixty");m3.put(70, "seventy");
        m3.put(80, "eighty");m3.put(90, "ninety");

        String hundred = "hundred";
        
        m1.keySet().stream().forEach(key -> {System.out.print(m1.get(key));});
        System.out.println("");
        m2.keySet().stream().forEach(key -> {System.out.print(m2.get(key));});
        System.out.println("");
        m3.keySet().stream().forEach((key) -> {
            m1.keySet().stream().forEach((km1) -> {
                System.out.print(m3.get(key) + m1.get(km1));
            });
        });     
        
        System.out.println("");
        m1.keySet().stream().forEach(key -> {System.out.print(m1.get(key) + hundred + m1.get(key));});
        System.out.println("");
        m2.keySet().stream().forEach(key -> {System.out.print(hundred + m2.get(key));});
        System.out.println("");
    }
}
