如何用VB编写一个3*3的0到50的数字
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 20:39:29
dimii=0forj=100to999ifjmod3=0thenif(j-6)mod10=0theni=i+1endifendifnext没有编译运行LZ自己试试
main(){inta[10][10],i,j;for(i=0;i
代码如下:PrivateSubForm_Click()DimaAsString,sAsInteger'定义变量s=1'初始化数据a=Val(InputBox("输入数值","数据输入"))'对变量赋值
dimnum3asintegerfori=1to1000ifimod3=0thennum3=num3+iendifnext
PrivateSubCommand1_Click()Dima,xAsSinglea=Val(Text1.Text)Ifa再问:x=x+a*0.2+3000*0.2怎么都乘0.2呀?
Subabc()'输入三角形三个边长,计算其面积Dima,b,c,sDos=InputBox("请输入三角形的三个边长,用半角逗号分隔."&Chr(13)&"输入-1时结束程序.")IfVal(s)=
#defineM4#includefloatmin(floatx,floaty){return(x
PrivateSubCommand1_Click()Fori=100To1000g=Mid(i,1,1)s=Mid(i,2,1)b=Mid(i,3,1)Ifi=g*g*g+s*s*s+b*b*bThe
这样才完整:判断不出错.N-1省去了许多判断,提高了效率.PrivateSubCommand1_Click()DimNAsIntegerDimiAsIntegerIfIsNumeric(Text1.T
举例说明:x=0:pi/100:2*pi;y=sin(x).*(0
dimnasintegerdimsasintgerPrivateSubCommand1_Click()Don=n+1s=s+nLoopuntills>=30000Printn-1EndSu
Total[Range[1,1000]]
Dimn%,cs,i%n=Text1cs="1":i=2DoIfnModi=0Thenn=n/i:cs=cs&"×"&iElsei=i+1EndIfLoopWhileiOptionExplicitPr
都写到这个地步了还上网来问?Dima,b,c,k1,k2,s1,s2AsDoublea=Value(Text1.Text);b=Value(Text2.Text);k1=a*3.14/180;k2=b
Private Sub Command1_Click()Dim i As Integer, j As Integer,&
先设置界面如下加法按钮代码voidCMy03Dlg::OnBnClickedButton1(){//TODO:在此添加控件通知处理程序代码UpdateData(TRUE);m_Nub3=m_Nub1+
你交作业啊,这么简单的问题,还好意思来这问.自己稍微动动脑子好不好,懒成这样,有没有点血性?!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e&
虽然说你设定无范围,但VB中规定的整数的取值范围,好象最大是32767,我没有查.dimaasintegera=rnd(32767)
PrivateSubCommand1_Click()DimiAsLongDimstrTmpAsStringFori=1To4strTmp=strTmp