提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • Jackson李南

    32人对此回答表示赞同

    有没有原始数据?程序界面怎样的?成绩数据从那里获取?

    程序界面就像表格一样,还要成绩全班平均分



    追答
    要求不明,无法编程



    展开
    32
    0回复
    发布于 7年前

    评论(0)

    收起评论

  • 白色季节

    32人对此回答表示赞同

    就是,数据源呢?是不是一个个的输入?

    是,还要成绩全班平均分



    展开
    32
    0回复
    发布于 8年前

    评论(0)

    收起评论

  • 一百零一夜

    32人对此回答表示赞同


    不好意思,老是粘贴错,再改一下,源代码我调试好了以后给你粘贴错了,这段代码我没有调试,不过应该可以的,你试试,不可以的话给我追问,我调试

    你在vb的安装路径下新建一个text1.txt,用来输入学生成绩和姓名,一个text2.txt,用来保存结果。注意text1.txt格式是这样的,

    张3,10

    李四,30

    王二,40

    private sub cmd_click()

    dim scount as integer'用来存储学生的个数

    scount=inputbox("请输入学生的个数")

    dim a() as integer'用来存储文件里的所有数据

    redim a(1 to 2*scount)

    open app.path&""&"text1.txt" for input as#1

    for i=1 to 2*scount

    input#1,a(i)

    next i

    close#1

    dim b() as integer'用来存储学生成绩

    redim b(1 to scount)

    dim c() as integer'用来存储学生姓名

    redim c(1 to scount)

    for i=1 to scount'读入学生成绩

    b(i)=a(2*I)

    next i

    for i=1 to scount'读入学生姓名

    c(i)=a(1+2*(i-1))

    next i

    for i=1 to scount-1'给成绩排序

    max=b(i)

    for j=i+1 to scount

    if b(j)>max then

    max=b(j)

    p=j

    temp=b(i)

    b(i)=b(p)

    b(p)=temp

    end if

    next j

    next i

    for i=1 to scount

    for j=1 to scount

    if b(i)=a(2*j) then

    c(i)=a(2*j)

    end if

    next j

    next i

    open app.path&""&"text2.text" for append as#1

    for i=1 to scount

    print#1,c(i),b(i)

    next i

    close#1

    end sub



    展开
    32
    0回复
    发布于 8年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部