計算機概論程式問題 - 考試
By Delia
at 2014-03-21T10:57
at 2014-03-21T10:57
Table of Contents
下列程式的迴圈執行完畢後,變數k的值為何?答案為B
int i,j,k=0;
for(i=1;i<=9;i++)
for(j=i;j<=i*i;j*=2)
k++;
(A)23 (B)25 (C)27 (D)29
想請問一下各位高手,for for中間沒有{}沒巢狀迴圈,那他們是如何跑的阿?
我程式太爛,可以麻煩各位給我一個解答嗎?謝謝
--
int i,j,k=0;
for(i=1;i<=9;i++)
for(j=i;j<=i*i;j*=2)
k++;
(A)23 (B)25 (C)27 (D)29
想請問一下各位高手,for for中間沒有{}沒巢狀迴圈,那他們是如何跑的阿?
我程式太爛,可以麻煩各位給我一個解答嗎?謝謝
--
Tags:
考試
All Comments
By Wallis
at 2014-03-23T10:52
at 2014-03-23T10:52
By Steve
at 2014-03-25T22:08
at 2014-03-25T22:08
By Valerie
at 2014-03-26T22:30
at 2014-03-26T22:30
By William
at 2014-03-29T12:27
at 2014-03-29T12:27
By Olive
at 2014-04-02T05:50
at 2014-04-02T05:50
By Lily
at 2014-04-04T10:15
at 2014-04-04T10:15
By Elma
at 2014-04-08T17:18
at 2014-04-08T17:18
By Carolina Franco
at 2014-04-11T10:35
at 2014-04-11T10:35
By Frederic
at 2014-04-12T09:31
at 2014-04-12T09:31
Related Posts
台電 電機(甲)上榜心得
By Dora
at 2014-03-21T10:50
at 2014-03-21T10:50
準備考試二三事(2-7)-以為自己知道其實並不知道的事
By Anthony
at 2014-03-21T10:18
at 2014-03-21T10:18
我高中畢業證書弄丟了
By Oscar
at 2014-03-21T09:33
at 2014-03-21T09:33
中華電信放榜
By Ethan
at 2014-03-21T09:03
at 2014-03-21T09:03
機械齒輪
By Rae
at 2014-03-20T23:23
at 2014-03-20T23:23