討論串[問題] 有關於巢狀If敘述
共 6 篇文章
內容預覽:
看了大家的回答,這篇我真的是愈看愈亂,也不確定各位對於原po的「假設」為何. 我一直把它解釋成這樣. if( (char)ch==h ) {. ch = reader.read();. if( (char)ch==r ) ch=reader.read();. else {// do somethin
(還有141個字)
內容預覽:
從你的碼看起來,你要的是程式先判斷 (c == h ?) 然後依序讀取並判斷是否為. r, e, f, a, b, 如果能讀到 b 就將 count + 1. 在 r-e-f-a- 過程中一不符合. 判斷就要跳開.. 由於有執行順序, 並且中途失敗就要中斷,可以利用 && 的 short-cut c
(還有453個字)
內容預覽:
把排版弄好看一點, 順便幫你去掉不必要的程式碼... if((char)c == h). {. c = reader.read();. if((char) c == r). c = reader.read();. if((char) c == e). c = reader.read();. if((
(還有1668個字)
內容預覽:
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個字)