BetinaUKTC

AndOr

Aug 28th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. && -> "и" (and)
  2. || -> "Или" (or)
  3.  
  4. ////////////ЛОГИЧЕСКО "И"///////////////////
  5. public class AndOr {
  6. public static void main(String[] args) {
  7.  
  8. boolean door1 = true;
  9. boolean door2 = true;
  10.  
  11. if (door1 == true && door2 == true){ // &&
  12. System.out.println("Pesho izbqga");
  13. } else {
  14. System.out.println("Pesho e tup");
  15. }
  16. }
  17. }
  18.  
  19. //////////////////ЛОГИЧЕСКО "ИЛИ"//////////////////////
  20.  
  21.  
  22. public class AndOr {
  23. public static void main(String[] args) {
  24.  
  25. boolean door1 = true;
  26. boolean door2 = true;
  27.  
  28. if (door1 == true || door2 == true){ // ||
  29. System.out.println("Pesho izbqga");
  30. } else {
  31. System.out.println("Pesho e tup");
  32. }
  33. }
  34. }
  35.  
  36.  
  37. //////////////////Домашно//////////////
  38. Калкулатор
  39.  
  40.  
  41. /*
  42.  
  43. 9 9 9
  44. 7 7 7
  45. + - *
  46. ---- ---- ---
  47. 16 2 63
  48.  
  49.  
  50. */
Advertisement
Add Comment
Please, Sign In to add comment