Czemu pokazuj że warunek samogłoski w pierwszej linii nie jest spełniony próbowalem z dużymi i małymi literami bez zmian
package pl.codegym.task.task09.task0923;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Samogłoski i spółgłoski
*/
public class Solution {
public static char[] samogloski = new char[]{'a', 'e', 'i', 'o', 'u','A','E','I','O','U'};
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
ArrayList<Character> samChars = new ArrayList<>();
ArrayList<Character> otherChars = new ArrayList<>();
ArrayList<Character> strChars = new ArrayList<>();
for(int i=0;i<samogloski.length;i++)
for(int l=0;l<str.length();l++)
if (str.charAt(l) == samogloski[i])
samChars.add(str.charAt(l));
for(int i=0;i<str.length();i++) {
if (!Character.isWhitespace(str.charAt(i)))
otherChars.add(str.charAt(i));
}
otherChars.removeAll(samChars);
for(char chr: samChars) System.out.print(chr+" ");
System.out.println();
for(char chr: otherChars) System.out.print(chr+" ");
}
// Ta metoda sprawdza, czy litera jest samogłoską
public static boolean isSamogloska(char c) {
c = Character.toLowerCase(c); // Konwertuje na małe litery
for (char d : samogloski) // Szuka samogłosek w tablicy
{
if (c == d)
return true;
}
return false;
}
}