开发者

meaning of this statement?

In a Pascal program, what does statement s1:=[0,3,7]开发者_如何学Python mean ?


s1 is a Pascal set variable, and it is being initialised so that the set contains the members 0, 3 and 7.


Pascal has first-class support for sets. s1 is presumably declared as a set, like

var  s1 : set of 0..10;

You can then write

if i in s1
// true when i is 0, 3 or 7
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜