Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定集合,例如 {1, 2, 4, 10, 6} 我怎样才能将元素 4 获取到变量 var。我想要的是从集合中获取元素“4”到变量 var: var = 4 并从集合中删除元素 4:set = {1, 2, 10, 6}
根据评论,听起来你想要这个:
with x \in set do var := x; set := set \ {x}; end with;