Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- System.out.println("Geben Sie ein Wort ein:");
- Scanner sc = new Scanner(System.in);
- String text = sc.next();
- text.toLowerCase();
- int count=0;
- for(int nummer =1; nummer<=6; nummer++){
- String diphtong = "";
- switch (nummer) {
- case 1:
- diphtong = "au";
- break;
- case 2:
- diphtong = "ai";
- break;
- case 3:
- diphtong = "Γ€u";
- break;
- case 4:
- diphtong = "ei";
- break;
- case 5:
- diphtong = "eu";
- break;
- default:
- diphtong = "ui";
- break;
- }
- Pattern pat = Pattern.compile(Pattern.quote(diphtong));
- Matcher m;
- for(m = pat.matcher(text); m.find(); count++);
- System.out.println(count);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement