Advertisement
RenSafaray

Untitled

May 10th, 2022
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. int a, b, c;
  2. Console.Write("a = ");
  3. a = Convert.ToInt16(Console.ReadLine());
  4. while (a > 1 || a < 0)
  5. {
  6. Console.WriteLine("a принимает значение в виде 0 или 1");
  7. Console.Write("a = ");
  8. a = Convert.ToInt16(Console.ReadLine());
  9. }
  10. Console.WriteLine("1. →");
  11. Console.WriteLine("2. ∧");
  12. c = Convert.ToInt16(Console.ReadLine());
  13. while (c > 1 || c < 0)
  14. {
  15. Console.WriteLine("Не существует такого действия." + "\r\n" + "Повторите попытку:");
  16. c = Convert.ToInt16(Console.ReadLine());
  17. }
  18. Console.Write("b = ");
  19. b = Convert.ToInt16(Console.ReadLine());
  20. while (b > 1 || b < 0)
  21. {
  22. Console.WriteLine("b принимает значение в виде 0 или 1");
  23. Console.Write("b = ");
  24. b = Convert.ToInt16(Console.ReadLine());
  25. }
  26.  
  27. if (a == 0 && b == 0)
  28. {
  29. if (c == 1) Console.WriteLine("Ответ. 1");
  30. if (c == 2) Console.WriteLine("Ответ. 0");
  31. }
  32. if (a == 0 && b == 1)
  33. {
  34. if (c == 1) Console.WriteLine("Ответ. 1");
  35. if (c == 2) Console.WriteLine("Ответ. 0");
  36. }
  37. if (a == 1 && b == 0) Console.WriteLine("Ответ. 0");
  38. if (a == 1 && b == 1) Console.WriteLine("Ответ. 1");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement