Untitled
unknown
plain_text
3 years ago
685 B
9
Indexable
public class Zaddom {
public static void main(String[] args) {
char[] slowo1 = {'l', 'o', 'k'};
char[] slowo2 = {'l', 'o', 't'};
if(slowo1.length == slowo2.length) {
Boolean equal = true;
int i = 0;
while (i < slowo1.length) {
if (slowo1[i] != slowo2[i]) {
equal = false;
System.out.println("nie są sobie równe");
break;
}
i++;
}
if (equal) {
System.out.println("równe");
}
} else {
System.out.println("Nie są sobie równe.");
}
}
}
Editor is loading...