您的位置:程序门 -> vb -> 基础类



大家好,我是菜鸟,能不能帮我做几道题啊?送分


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


大家好,我是菜鸟,能不能帮我做几道题啊?送分
发表于:2007-06-21 18:07:58 楼主
1\从键盘输入五个数到数组s(5)中,并求s(5)中最大元素的值和下标.
2、以1、2、3、4、5为边长,可以形成多少个三角形,不考虑相同情况,请输出这些三角形的三个边长。
3、用递归的方法,求两个正整数(a,b)的最大公约数,已知a和b的公约数于b和a   mod   b的公约数相同,请选出相应的function.
4、从键盘输入二位数组a(4,5)共30个元素,编写程序求这30个最大数以及这个数的数组下标.
5,在窗体上随机打印100个小写的英文字母(a的ask码为97)。
6、编写程序在文本框中任意输入一个字符在窗体上,输出该字符的ask
7、用递归的方法打印如下图形。
                                                  1
                                                  121
                                                  12321
                                                  123454321
                                                  12345678987654321
发表于:2007-06-21 18:08:421楼 得分:0
用vb做!
发表于:2007-06-21 19:02:572楼 得分:0
这些问题也太菜了吧
发表于:2007-06-22 21:20:073楼 得分:0
我真是不会帮帮忙吧!跪求
发表于:2007-06-23 09:48:264楼 得分:0
zui   da   gong   yue   shu  
      public   function   zdgys(byval   a   as   integer,   byval   b   as   integer)   as   integer
                dim   result   as   integer
                if   b   =   0   then
                        result   =   0
                elseif   a   =   0   then
                        result   =   0
                else
                        if   a   mod   b   =   0   then
                                result   =   b
                        end   if
                        if   b   mod   a   =   0   then
                                result   =   a
                        end   if
                        if   a   >   b   then
                                result   =   zdgys(b,   a   mod   b)
                        elseif   a   <   b   then

                                result   =   zdgys(a,   b   mod   a)
                        else   :   result   =   a
                        end   if
                end   if

                return   result
        end   function
发表于:2007-06-23 10:02:495楼 得分:0
public   sub   a()
                dim   a(5),   b(5)   as   integer
                dim   i   as   integer
                for   i   =   1   to   5
                        a(i)   =   cint(inputbox( "number? "))
                        b(i)   =   a(i)
                next
                dim   mid   as   integer
                for   i   =   1   to   5   -   1
                        if   a(i)   <   a(i   +   1)   then
                                mid   =   a(i)
                                a(i)   =   a(i   +   1)
                                a(i   +   1)   =   mid
                        end   if
                next

                for   i   =   1   to   5
                        if   b(i)   =   a(1)   then
                                msgbox( "zhui   da   de   shi: "   +   cstr(a(1))   +   "ta   shi   di "   +   cstr(i)   +   "xiang! ")
                        end   if
                next

        end   sub
发表于:2007-06-23 10:15:246楼 得分:0
public   sub   t()
                dim   generator   as   new   random
                dim   randomvalue   as   integer
                randomvalue   =   generator.next(97,   122)
                msgbox(chr(randomvalue))
        end   sub


快速检索

最新资讯
热门点击