討論串[請益] MTK 面試測驗請教
共 14 篇文章

推噓3(3推 0噓 3→)留言6則,0人參與, 最新作者fuha (mimi)時間15年前 (2010/06/12 21:53), 編輯資訊
0
0
0
內容預覽:
template <int>. struct Functor{};. template <>. struct Functor<1> { Functor() {func1();} };. template <>. struct Functor<2> { Functor() {func2();} };.
(還有681個字)

推噓2(2推 0噓 1→)留言3則,0人參與, 最新作者del680202 (HANA)時間15年前 (2010/06/12 14:51), 編輯資訊
0
0
0
內容預覽:
第一題有想到妖道一點的做法. #define _FUN(X) func##X(). #define FUN(s) _FUN(s). void main(int n). {. FUN(n);. }. 不過這招要Preprocessor有支援將n解析回int才行. 這招我用dev-c++就跑不過了 一定
(還有34個字)

推噓10(10推 0噓 3→)留言13則,0人參與, 最新作者KanoLoa (卡)時間15年前 (2010/06/12 12:53), 編輯資訊
0
0
0
內容預覽:
void main(int n). {. while(n==1){func1();break;}. while(n==2){func2();break;}. while(n==3){func3();break;}. while(n==4){func4();break;}. while(n==5){f
(還有9個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者bleed1979 (十三)時間15年前 (2010/06/12 08:45), 編輯資訊
0
0
0
內容預覽:
一定用if表達的話,我以為是divide and conquer,總比較次數最低。. if ( n > 231 ). {. if ( n > 324 ). func5;. else. func3;. }. else. {. if ( n > 67 ). func4;. else. {. if ( n

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者ibmibmibm (殺.人.鬼)時間15年前 (2010/06/12 01:28), 編輯資訊
0
0
0
內容預覽:
extern void f1(void);. extern void f2(void);. extern void f3(void);. extern void f4(void);. extern void f5(void);. int main(int n) {. static void (*x[