import javax.swing.JOptionPane void Zadanie4() { def result = [] def list = ["zero", "jeden", "dwa", "trzy", "cztery", "pięć", "sześć", "siedem", "osiem", "dziewięć"] def number = JOptionPane.&showInputDialog("Podaj liczbę") number.each { result.add(list[it.toInteger()]) } println result.join(" - ") } void Zadanie5() { def productsMap = [:].withDefault { 0 } def product = '' while (true) { product = JOptionPane.&showInputDialog("Podaj: nazwa produktu=cena", product) if (product == null || product.equals("")) break def productInfo = product.split("=") if (productInfo.size() == 2 && productInfo[1].isInteger()) { productsMap[productInfo[0]] += productInfo[1].toInteger() product = '' } else product = "Nie poprawna wartość: $product" } println productsMap } Zadanie4() Zadanie5()