好的,我将解释您可能通过调试或简单地阅读有关Pascal的教科书来发现什么:
线路:
c := (a+b)*(a-b);
是否执行以下操作:
a + b is the union of the two sets, i.e. all elements that are
in a or in b or in both, so here, that is [2, 3];
a - b is the difference of the two sets, i.e. it is a minus the
elements of a that happen to be in b too. In this case, no
common elements to be removed, so the result is the same as a,
i.e. [3]
x * y is the intersection of the two sets, i.e. elements that are in
x as well as in y (i.e. a set with the elements both have in common).
说
x := a + b; y := a - b;
,则可将其切除为:
x := a + b; // [3] + [2] --> [2, 3]
y := a - b; // [3] - [2] --> [3]
c := x * y; // [2, 3] * [3] --> [3]