编写一个程序,计算1至n之间的累加和,其中,n通过文本框由用户指定.

解决方案 »

  1.   

    dim i as integer
    dim count as integer
    count = 0
    for i =1 to cint(n) do
      count =count +i
    loop
      

  2.   

    dim a,n as double
    n=val(text1.text)
    a=(n+1)n/2
    msgbox a这位兄弟,纯数学问题,不知道咋解决了?
      

  3.   

    dim i as long
    dim N as long
    dim Count as long
    N=clng(Text1.text)count =0
    for i = 1 to N
       count = count + i
    next i
    msgbox count
      

  4.   

    OK。是不该用循环。不过大家一起陷入误导中了,想起的都是初学的。对不起,重写!!
    dim N as long
    dim Count as long
    N=clng(Text1.text)
    count = (1+N)*N/2
    msgbox count
      

  5.   

    * ^ $ @ # - % ! * ... ....   ....咣叽...~ * # + ~ & ......