[题目分析] 设n个元素存放在数组A[n]中设S初始为空集可依次将数组A的每一个元素并入S产生了含一个元素的若干集合再以含一个元素的集合为初始集合依次并入A的第二个(异于S的那个元素)元素并入S形成了含两个元素的若干集合……如此下去直至A[i]的全部元素并入
CONST n=;
TYPE datatype=char;
VAR A: array[n] OF datatype;
PROC powerset(s:set OF datatype)
[outset(s); //输出集合S
FOR i:= TO n DO powerset(S+A[i]);
]
ENDP;
调用本过程时参数S为空集[]
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []