-7
A
回答
0
通過這個步驟,看看爲什麼x將始終小於5:
x=1;
while x<5;
x=2; // You set x to 2 at the beginning of every single iteration
x=x+2; // At this point, x == 4
if x==4; // The "if" is unnecessary - of COURSE x == 4 - how could it possibly be anything else?
x=x-1; // x now contains 3
end
end
在每次迭代,然後,X ==開始2.在迭代結束時,x == 3.
+0
謝謝EJoshuaS –
相關問題
- 1. 如果語句內while循環錯誤
- 2. while循環無限循環,如果它達到elif語句
- 3. 循環while語句
- 4. Javascript while while語句循環
- 5. 無限循環使用的語句
- 6. While循環語法錯誤
- 7. routeWarning造成無限循環
- 8. while語句無限
- 9. while while循環無限
- 10. 無限'while'循環
- 11. 在while循環中使用if語句
- 12. 在while循環中使用switch語句
- 13. 使用while語句打破循環
- 14. 無限while循環和java中的循環錯誤計數
- 15. python while循環break語句
- 16. While循環與if語句
- 17. while循環,開關語句
- 18. if語句while循環JAVA
- 19. While循環和if語句
- 20. 應該有這無限的2個break語句while循環
- 21. Do-While語句卡在無限循環中
- 22. 卡住在無限while循環(與switch語句)
- 23. 功能和while語句創建無限打印循環
- 24. If/else語句和while while循環
- 25. 準備語句內部while循環生成的準備語句
- 26. while(1)循環無限循環的TAC
- 27. JavaScript嵌套while循環,循環無限
- 28. 的Javascript while循環無限循環
- 29. while循環python導致無限循環
- 30. 無限循環in while
爲什麼這被標記爲C++? – EJoshuaS
爲什麼它在這裏?使用鉛筆和紙,並自己解決! –
我對語法有些不熟悉,但是看起來他們在每次迭代時都將x設置爲2,如果x達到4,他們減1,所以顯然x不可能達到5。事實上,如果我正在閱讀這個正確的x在每次迭代結束時應該包含3(如果我錯了,請糾正我)。 – EJoshuaS