题目描述

In this chapter, we discussed the logical operators &&, || and !. De Morgan’s laws can sometimes make it more convenient for us to express a logical expression. These laws state that the expression !( condition1 && condition2 ) is logically equivalent to the expression ( !condition1 || !condition2 ). Also, the expression !( condition1 || condition2 ) is logically equivalent to the expression ( !condition1 && !condition2 ). Use De Morgan’s laws to write equivalent expressions for each of the following, then write a program to show that the original expression and the new expression in each case are equivalent:
$a) !(x<5) \& \& !(y>=7) $
$b) ! (\mathrm{a}==\mathrm{b})|| !(\mathrm{g} !=5) $
$c) ! ( (x<=8) \&\& (y>4)) $
$d) !((i>4)||(j<=6)) $


输入格式

No need for input.


输出格式

You are required print the result of a-b with correct format. (Note we gave the answer a and b, you need to output all the results a-d. Please note the spaces!)


样例数据

输入


                            

输出

PART A

!( x < 5 ): true
!( y >= 7 ): true
!(x < 5) && !(y >= 7) is equivalent to !((x < 5) || (y >= 7))

!( x < 5 ): true
!( y >= 7 ): false
!(x < 5) && !(y >= 7) is equivalent to !((x < 5) || (y >= 7))

!( x < 5 ): false
!( y >= 7 ): true
!(x < 5) && !(y >= 7) is equivalent to !((x < 5) || (y >= 7))

!( x < 5 ): false
!( y >= 7 ): false
!(x < 5) && !(y >= 7) is equivalent to !((x < 5) || (y >= 7))



PART B

!( a == b): true
!( g != 5): true
!(a == b) || !(g != 5) is equivalent to !((a == b) && (g != 5))

!( a == b): true
!( g != 5): false
!(a == b) || !(g != 5) is equivalent to !((a == b) && (g != 5))

!( a == b): false
!( g != 5): true
!(a == b) || !(g != 5) is equivalent to !((a == b) && (g != 5))

!( a == b): false
!( g != 5): false
!(a == b) || !(g != 5) is equivalent to !((a == b) && (g != 5))

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解