VB程序设计:求满足1^2+2^2+...+n^2>1000的最小n值。(要求使用While...End While语句实现)?

一定要用While...End While语句实现
2025-04-03 19:32:07
推荐回答(1个)
回答1:

Private Sub Command1_Click()

  n = 0

  s = 0

  While s <= 1000

    n = n + 1

    s = s + n * n

  Wend

  Print "n="; n, "s="; s

End Sub