我在函數中寫了一個while loop,但不知道如何阻止它。當它不符合最終條件時,循環會永遠持續下去。我怎樣才能阻止它? def determine_period(universe_array):
period=0
tmp=universe_array
while True:
tmp=apply_rules(tmp)#aplly_rules is a an
我不確定問題出在哪裏,但是當我嘗試在代碼中使用while語句時,我一直收到此錯誤。 無效令牌「而」類, 結構或接口成員 聲明 我想用一個while循環有東西,而一個說法是正確的不斷更新。 我的代碼的其餘部分是相當長的,但每當我在語法類型: while(a<b)
{
//do whatever i want it to do here
}
它給我,編譯器錯誤馬上蝙蝠。不太清楚問題是什麼。我
進行審覈時,我有時會遇到這樣一種循環: i = begin
while (i != end) {
// ... do stuff
if (i == end-1 (the one-but-last element)) {
... do other stuff
}
increment i
}
然後,我問一個問題:你寫的嗎? i = begi