批踢踢實業坊
›
看板
NCU96Stat
關於我們
聯絡資訊
返回看板
作者
jackdan (Sean)
看板
NCU96Stat
標題
while loop
時間
Fri Feb 22 12:24:00 2008
#Find maximum n such that 1+2+3+...+n≦S tmp<-function(S) { sum=0 counter=1 while(sum<=S) { sum=sum+counter if(sum<=S) counter=counter+1 } cat(counter-1, "\n") } --
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.45.117