102高考資料處理 Java - 考試
By James
at 2013-07-18T11:09
at 2013-07-18T11:09
Table of Contents
三、請問執行下列JAVA 程式碼後的結果為何?請繪製此程式的流程圖。(20 分)
01. public class ShowClass {
02. public static void main( String[] args )
03. {
04. int row = 4;
05. int column;
06.
07. while ( row >= 1 )
08. {
09. column = 1;
10.
11. while ( column <= 5 )
12. {
13. System.out.print( row % 2 == 1 ? "<-" : "->" );
14. ++column;
15. } // end while
16.
17. --row;
18. System.out.println();
19. } // end while
20. } // end main
補習班公佈的流程圖不才是看得懂,而補習班的輸出結果為:
->->->->->
<-<-<-<-<-
->->->->->
<-<-<-<-<-
因為本身非資訊背景,所以想請教各位程式的
13. System.out.print( row % 2 == 1 ? "<-" : "->" );
列2是否等於1?甚麼意思?
14. ++column;
它跟C語言的前置模式的用法是一樣的嗎?
17. --row;
原因同上
這三行明確的意思?(感覺它是一個字串的二維陣列,但是這三行不懂,無法下結論。)
由於考試有時會考程式題,順便請問各位,市面上有無針對初學者或非資訊背景的C語
言、Java程式簡單易懂的入門書(感覺只憑補習班上的課是不夠的),不才只想把基本的
指令語法搞懂可應付考試就好,有的話也煩請推薦一下。
以上問題再麻煩各位了,感謝!
--
All Comments
By Ivy
at 2013-07-21T01:54
at 2013-07-21T01:54
By Mia
at 2013-07-25T21:55
at 2013-07-25T21:55
By Enid
at 2013-07-29T11:32
at 2013-07-29T11:32
By Barb Cronin
at 2013-07-30T01:43
at 2013-07-30T01:43
By Daniel
at 2013-07-30T17:53
at 2013-07-30T17:53
By Franklin
at 2013-08-03T11:22
at 2013-08-03T11:22
By Bennie
at 2013-08-06T00:28
at 2013-08-06T00:28
By Elma
at 2013-08-09T00:16
at 2013-08-09T00:16
By Elvira
at 2013-08-09T13:13
at 2013-08-09T13:13
By Bennie
at 2013-08-09T22:01
at 2013-08-09T22:01
Related Posts
102 高考貨銀 第一題
By Agnes
at 2013-07-18T10:15
at 2013-07-18T10:15
地方特考缺額及一些問題
By Tom
at 2013-07-18T10:05
at 2013-07-18T10:05
最新學年度三元後中書籍出清
By Charlotte
at 2013-07-18T09:32
at 2013-07-18T09:32
想要補志光的解題班或是全科班
By Ingrid
at 2013-07-18T09:18
at 2013-07-18T09:18
警特准考證
By Donna
at 2013-07-18T08:16
at 2013-07-18T08:16