我想將c#中的一些代碼轉換爲C++,但缺乏字典表/枚舉等,這使得我很難在C++中獲得所需的結果。任何人都可以幫助使用C++中的容器/方法來獲得所需的結果嗎?尋找合適的容器/函數在C++中枚舉
在此先感謝。
找到所有C1,它通過C1的次數羣,其中C2> 0和c3 < 4由C1
table(c1,c2,c3) (number of rows expected is not finite - so - can't use Array as a structure for this)
5 1 2
4 2 3 --> edited this line to make it into the list
4 4 3
4 0 1 --> ignore this row as c2=0
3 1 3
2 1 5 --> ignore this row as c3 > 4
.....
爲了.....
expected output(number of rows meeting criteria for each c1):
3 1
4 2
5 1
感謝syam。我正在使用c + + 11,實際上開始了一些類似的道路,但無法取得很大進展。在c#中,我可以創建基表的過濾器(視圖),然後應用過濾器/組/排序選項以獲取所需的輸出。會再做一次,看看我能不能得到任何東西..謝謝 – ejuser 2013-05-06 11:28:51
換句話說 - 由於我有限的c + +技能,無法獲得太多...... – ejuser 2013-05-06 11:40:25
@ejuser:我編輯了我的答案,包括一個'vector/tuple'示例。 – syam 2013-05-06 13:44:21