0
값을 가져 와서 사전에서 값을 찾은 다음 삭제하고 사전을 통해 함수를 만드는 함수를 만들려고합니다. 그래서 (사전에있는 값의 키가 INT 1의 값과는) 같은 값의 키는 이후 한 이하 : 귀하의 예제에서 코드를 기반으로사전에서 항목을 삭제하고 다른 사람의 키를 변경하는 방법 F #
는let deleteitem (item: Gitem) =
let mutable count = 1
while count<=invendict.Count do
let testitem = invendict.Item[count]
if item = testitem then
invendict.Remove[count]
//from here, look at every value, whos key is higher than the key of
the removed value, and decreases the key by one, till every value is looked at
1) 사전으로 사용하는 데이터 구조는 무엇입니까? 2) 당신의 키가 인덱스 일 경우,'ResizeArray'를 사용하는 것이 훨씬 더 의미가 있습니다. –
사전은 (Int, Gitem) –
'System.Collections.Generic.Dictionary'입니까? 열쇠를 나타 내기 위해 열쇠가 무엇을 나타 냅니까? –