Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public static void main(String[] args) {
  2. System.out.println("Geben Sie ein Wort ein:");
  3. Scanner sc = new Scanner(System.in);
  4. String text = sc.next();
  5. text.toLowerCase();
  6. int count=0;
  7. for(int nummer =1; nummer<=6; nummer++){
  8. String diphtong = "";
  9.  
  10. switch (nummer) {
  11. case 1:
  12. diphtong = "au";
  13. break;
  14. case 2:
  15. diphtong = "ai";
  16. break;
  17. case 3:
  18. diphtong = "Γ€u";
  19. break;
  20. case 4:
  21. diphtong = "ei";
  22. break;
  23. case 5:
  24. diphtong = "eu";
  25. break;
  26. default:
  27. diphtong = "ui";
  28. break;
  29. }
  30. Pattern pat = Pattern.compile(Pattern.quote(diphtong));
  31. Matcher m;
  32. for(m = pat.matcher(text); m.find(); count++);
  33. System.out.println(count);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement