自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 判断该年是否为闰年,并根据给定的月份判断该月有多少天

闰年是可被4整除不能被100整除,即:y Mod 4=0  And y Mod100       Private Sub Command1_Click()            Dim y As Integer, m As Integer, days As Integer            Dim leap As Boolean           If   Text1.Text="

2012-05-31 09:13:59 4829

原创 在文本框中输入任一串英文字符,将他们进行大小写转换

包含1个label1 ,1个text1和3个按钮。     Private Sub Text1_KeyUp (KeyCode As Integer, Shift As Integer)          Text1.Tag=Text1.Text    End Sub  Private Sub Form_Activate()       Text1.SetFocus End Sub P

2012-05-31 08:23:11 1185

原创 复习时所知内容1

1,整除的符号是“\”,不进行四舍五入,直接得出整数部分。        2,符号的优先级:^幂运算,-负号,*乘,/ 除,\ 整除,mod取余数,+加,- 减,& 和+连接,等于不等于号,not ,and,or ,  xor 异或,eqv 等价,imp 蕴含,=赋值        3,数学函数:Abs(X) 绝对值函数,Sgn(X) 符号函数,Exp(X) 幂运算函数        4,I

2012-05-30 20:26:05 338

原创 点击按钮1时出现拖动框,点击按钮2时不出现,并将mytextbox中的任意字符在vb.text中输出

dim withevents mytextbox as vb.textbox   private sub command1-click()     'dim mytextbox as vb.textbox      setmytextbox=me.controls.add("vb.textbox","mytextbox") mytextbox.move me.command1.left-

2012-05-24 08:53:51 462

原创 使用模块通用编写任输出n个不相等的数

private sub command1-click()      n=intput box("请输入一个正整数")    dim str2 as string    call getninteger(n,str2)    label1.caption=left(str2,len(str2)-1) end sub   模块中: sub getninteger(byval n as

2012-05-17 08:20:49 220

原创 10个随机数中没有重复的数

上几节课上老师让写过一个随机生成10个数,这节课上又指出10个数中没有重复的数,过程如下:                       private  sub  command1-click()                             dim a(10) as integer                             dim printstr as strin

2012-05-10 08:28:23 322

原创 任意前n个数求和

private function sum(n as integer) as integer          if   n           sum=n+sum(n-1)         else         sum=1      end if     private sub command1-click()        print sum(2)     end sub

2012-05-10 08:04:46 1757

原创 提取最值与中介值

我记得老师的过程好像是这个:   dim m as integer dim a(9) as integer  print str(ubound(a))  print str (  ( ubound(a)-lbound(a)+1 )  \  2   )   dim larray() as integer redim larray(0 to m)  redim rarry(0 to ub

2012-05-05 11:27:16 408

原创 运用递归思想求100以内整数的和

上节课老师讲了用递归思想求100以内整数的和,主要内容如下:  private sub command1-click()        print str(f(100))    end sub   function f(n as integer) as integer   if  n=1 then      f=1   else    f=n+f(n-1)    end if

2012-05-05 10:42:51 751

原创 10位数程序实现输出最大值

好不容易上个网,就允许我多写几篇吧!  这次是建了个command,点击写的。  Dim max as integer    Dim mystr as string    mystr = " "   for i = 0 to 9 mystr = mystr + " "+ str(f(i)) ' print str(f(i)) Next i print  mystr  max

2012-04-26 09:41:32 378

原创 比较三位数大小,输出最大的一个

主要内容应该是:   Dim a As integer         Dim b As integer         Dim c As integer     If a>=b then         max =a      else max =b End if  if c>=max  then        max =c End if Print max 心得体

2012-04-26 09:29:53 848

原创 求100以内的素数的和

Private Sub Command1-click()    Dim i as integer    Dim s as integer    s=0 For  i=2 to 100 if sushu(i) then s=s+i Next  i Print s End  Sub Function  sushu (n as integer) as boolean      D

2012-04-26 09:18:53 561

原创 比较两位数的大小

比较两位数的大小,主要步骤:     Dim m as integer                 Dim n  as integer          if m>=n then           print m           else            print n        end if   心得体会:有 if  的时候别忘了写  end if  。

2012-04-26 09:08:50 385

原创 计算机VB作业

计算机实验报告       专业:11级教育学   班级:一班   姓名:耿学会   学号:11110141003   日期:2011.3.21                   实验一:显示各位数 一、实验目的: 充分认识计算机vb语言及其能够处理的数据类型。

2012-04-05 10:11:55 686

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除