将S作为一组子集,我想将其打印出来并对其进行索引:
set S[]:=subsets({1..5}, 3);
do forall <i> in S do print S[i];
# Neither does the following work:
do print S;
我收到以下错误:
Reading debug.zpl
*** Error 142: Unknown index <> for symbol "S"
*** File: debug.zpl Line 2
*** do forall <i> in S do print S[i];
*** ^^^
如何索引子集集?
答案 0 :(得分:1)
do forall <i> in indexset(S) do print S[i];
应该做。