[問題] 一小段遞迴程式問題

看板C_and_CPP (C/C++)作者 ( 123)時間16年前 (2010/01/11 02:19), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
小妹程式弱弱的 寫了一段遞迴 實在不清楚錯在哪 希望大家能幫我看看 int count(int n, int s, int t){ int x=0; if(n==2) return 1; if(n>=3){ for(int v_i=1;v_i<=5;v_i++){ if(tmpM[s][v_i] && !on_path(s,v_i,t)){ x += count(n-1, s, t); } } return x; } } 錯誤訊息: In instantiation of `std::iterator_traits<int>': 95 instantiated from here 129 stl_iterator_base_types.h `int' is not a class, struct, or union type Build Error What's wrong? 0.o 希望大大們能不吝回答~ 感恩 ^_^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 112.104.85.56

01/11 02:54, , 1F
你整份程式找置底空間貼上來好了...光這裡看不太出來
01/11 02:54, 1F

01/11 10:34, , 2F
妳應該要先講what's correct才能談what's wrong
01/11 10:34, 2F
文章代碼(AID): #1BIXeUa- (C_and_CPP)
文章代碼(AID): #1BIXeUa- (C_and_CPP)