討論串[問題] 有關於巢狀If敘述
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓0(0推 0噓 2→)留言2則,0人參與, 最新作者annheilong (方格子)時間14年前 (2011/03/19 11:36), 編輯資訊
0
0
0
內容預覽:
while((char)c == h) {. if((char)reader.read() != r). break;. if((char)reader.read() != e). break;. if((char)reader.read() != f). break;. if((char)read

推噓4(4推 0噓 2→)留言6則,0人參與, 最新作者tropical72 (藍影)時間14年前 (2011/03/18 22:47), 編輯資訊
0
0
0
內容預覽:
看了大家的回答,這篇我真的是愈看愈亂,也不確定各位對於原po的「假設」為何. 我一直把它解釋成這樣. if( (char)ch==h ) {. ch = reader.read();. if( (char)ch==r ) ch=reader.read();. else {// do somethin
(還有141個字)

推噓3(3推 0噓 4→)留言7則,0人參與, 最新作者yauhh (喲)時間14年前 (2011/03/18 22:31), 編輯資訊
0
0
1
內容預覽:
從你的碼看起來,你要的是程式先判斷 (c == h ?) 然後依序讀取並判斷是否為. r, e, f, a, b, 如果能讀到 b 就將 count + 1. 在 r-e-f-a- 過程中一不符合. 判斷就要跳開.. 由於有執行順序, 並且中途失敗就要中斷,可以利用 && 的 short-cut c
(還有453個字)

推噓4(4推 0噓 0→)留言4則,0人參與, 最新作者loveme00835 (朴髮箍)時間14年前 (2011/03/18 20:30), 編輯資訊
0
0
0
內容預覽:
把排版弄好看一點, 順便幫你去掉不必要的程式碼... if((char)c == h). {. c = reader.read();. if((char) c == r). c = reader.read();. if((char) c == e). c = reader.read();. if((
(還有1668個字)

推噓1(1推 0噓 4→)留言5則,0人參與, 最新作者scott260202 (Cake)時間14年前 (2011/03/18 15:07), 編輯資訊
0
0
0
內容預覽:
if((char)c == h) {. c = reader.read();. if((char) c == r) {. c = reader.read();. if((char) c == e) {. c = reader.read();. if((char) c == f) {. c = rea
(還有153個字)
首頁
上一頁
1
2
下一頁
尾頁