Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The code
public class Main {
public static void main(String[] args) {
System.out.println("R = !(!x && y) || (x && !z)");
System.out.println("Таблица истинности");
System.out.println("X Y Z R");
out(false,false,false);
out(false,false,true);
out(false,true,false);
out(false,true,true);
out(true,false,false);
out(true,false,true);
out(true,true,false);
out(true,true,true);
}
public static void out(boolean x, boolean y, boolean z){
System.out.println((x ? "1 " : "0 ") + (y ? "1 " : "0 ") + (z ? "1 " : "0 ") + (!(!x && y) || (x && !z) ? " 1" : " 0"));
}
}
I'll wash it somehow.
public class Main {
public static void main(String[] args) {
System.out.println("Таблица истиности для выражения !(!x && y) || (x && !z)");
System.out.println(" X Y Z !(!x && y) || (x && !z)");
out(true,true,true);
out(false,false,false);
out(true,true,false);
out(false,false,true);
out(true,false,true);
out(false,true,false);
out(true,false,false);
out(false,true,true);
}
public static void out(boolean x,boolean y,boolean z){
System.out.println((x?"Истина ":" Ложь ")+(y?"Истина ":" Ложь ")+(z?"Истина ":" Ложь ")+(!(!x && y) || (x && !z)?" Истина":" Ложь"));
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question