From Łukasz , 6 Years ago, written in Java.
This paste is a reply to
PD from Łukasz
-
go back
Embed
Viewing differences between
PD and
Re: PD
\npackage PracaDomowa5;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Words {
public static void main(String[] args) {
String word1 = "Wlazl kotek na plotek";
System.out.println("Wlzazl kotek na plotek --> " + word1.substring(6).replace("ek", "").
replace("plot", "most"));
String word2 = new String("Dobry wieczor");
System.out.println("Dobry wieczor --> " + word2.replace("obry", "zien").
replace("wieczor", "dobry"));
String word3 = "Zielona pilka";
System.out.println("Zielona pilka --> " + word3.replace("ielona", "lapalem").
replace("pilka", "pilke"));
Scanner s = new Scanner(System.in);
System.out.println("Podaj zdanie: ");
String word = s.nextLine();
nextLine().toLowerCase();
Map map = new HashMap<>();
for (int i = 0; i < word.length(); i++) {
char c = word.charAt(i);
if (c == 'A' || ( c == 'a' || c == 'E' || c == 'e' || c == 'I'
'e'
|| c == 'i' || c == 'O' || c == 'o' || c == 'U' || c == 'u') {
Integer count = map.get(c);
map.put(c, (count == null ? 1 : count + 1));
}
}
System.out.println(map);
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}