乘乘乘

来源:互联网 发布:linux上安装jdk 编辑:程序博客网 时间:2024/04/25 08:07


Private Sub Command1_Click()

 

Dim n1 As Byte

Dim n2 As Byte

Dim yushu As Byte

Dim shang As Byte

Dim tempresult As Byte

n1 = Int(Val(Me.Text1.Text))

n2 = Int(Val(Me.Text2.Text))

 

tempresult = n1 * n2

yushu = tempresult Mod 10

shang = tempresult \ 10

 

Print shang & yushu

 

End Sub

Option Base 1

Private Sub Command1_Click()

Dim n1() As Byte, n1len As Long

Dim n2() As Byte, n2len As Long

Dim yushu1 As Byte, yushu2 As Byte

Dim shang As Byte

 

Dim tempresult As Byte

n1len = Len(Me.Text1.Text)

n2len = Len(Me.Text2.Text)

 

 

ReDim n1(n1len)

ReDim n2(n2len)

For i = LBound(n1) To UBound(n1)

n1(i) = Mid(Me.Text1.Text, i, 1)

Next

For i = LBound(n2) To UBound(n2)

 

    n2(i) = Mid(Me.Text2.Text, i, 1)

Next

   tempresult = n1(2) * n2(1) + shang

   yushu1 = tempresult Mod 10

   shang = tempresult \ 10

   

   tempresult = n1(1) * n2(1) + shang

   yushu2 = tempresult Mod 10

   shang = tempresult \ 10

   Print shang & yushu2 & yushu1

End Sub

 


找了好久错误出在哪 4*15=40    想想应该是shang没加上  从头到尾  顺序 n1 n2 都找了  最后发现单词错了   太尴尬了   课本不熟悉  不知道老师讲的什么  生搬硬套还费力  还要继续下功夫  每次上vb课  都有一种学无止境的感觉  也感觉自己放在学习上的时间有点少 如果说考试可以最后一个月应付,但是知识却是一天天积累的,可每天留该学习的时间还是很少,最近晚上和早上已经没时间了,中午能睡会就是奢望,平时上课不睡觉就是棒棒的,现在想想,想学习,课上不学 课下恶补还没时间 纯属自己找trouble。课上抓住时间最高效。

老师奖励给我买书,看到各种书好兴奋,可是好久都没看书了,脑子里空空的。看到当当上的书就想买,和卖衣服一样,根本停不下来。看来我还得做个安静的美女子。书架上这么多书都没看呢,可不能这样浪费时间,行动!!!

明天的C 和高数   刚把爹!!!!my god  日语还没检测。。。。  每天满满的,就没有时间伤心了,我不勉强自己,想哭就哭,想笑就笑。偶尔会想起你,也只是轻描淡写,一掠而过,我也不允许自己一直悲伤,我还有很多事情要做。老师说得对,这四年一切皆有可能,你的积蓄四年之后就会有体现~

晚安,VB~我还要继续奋斗!

                                                                                                                                                                             2016/4/14    23:41


0 0
原创粉丝点击