编写一个求三角新面积的VB应用程序
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/13 20:01:07
FunctionS(rAsSingle)AsSingle'Function过程Constpi=3.1415926535898S=pi*r^2EndFunctionPrivateSubForm_Clic
运用海伦公式dimPaslong,Saslongifa+b>cthenifb+c>athenifa+c>bthenp=(a+b+c)/2S=sqr(p*(p-a)*(p-b)*(p-c))endife
PrivateFunctionSUM(Fir_LAsDouble,Fir_SAsDouble,Scend_LAsDouble,Scend_SAsDouble)AsDoubleSUM=Fir_L*Fir
PrivateSubCommand1_Click()Dima,xAsSinglea=Val(Text1.Text)Ifa再问:x=x+a*0.2+3000*0.2怎么都乘0.2呀?
函数定义名Area,参数rFunctionArea(r)Area=3.1415926*r*rEndFunction调用例子:PrivateSubCommand1_Click()Label1.Capti
'最大公约数FunctiongetGcd(num1AsLong,num2AsLong)AsLongDimiAsLongFori=IIf(num1Ifnum1Modi=0Andnum2Modi=0The
#include#defineN10longfun(int(*num)[10],intn){inti,j;longs=1;for(i=0;i再问:能加Q不能另50给你974663046再答:加了,采纳
PrivateSubCommand1_Click()DimbjAsSingleDimzzAsSingleDimmjAsSinglebj=CSng(Text1.Text)Ifbj
dimrassingle,sassingler=inputbox("请输入圆的半径:")s=3.14159*r^2print"圆的面积是:";s
PrivateSubcommand1_click()DimmAsInteger,nAsIntegerDimaAsInteger,bAsIntegerDimrAsIntegerm=InputBox("输
PrivateSubbtnstart_Click()'按要求写了If-Then语句,不过个人认为Select-Case比较适合这个.IfMe.txbplanet.Text="Jupiter"Then'
PrivateSubCommand1_Click()'IntegerRandomizeLabel1.Caption=Int(Rnd*(101)-50)EndSubPrivateSubCommand2_
Private Sub Command1_Click()Dim i As Integer, j As Integer,&
将六个圆命名为“Oval1”直到“Oval6”在窗体上放6个timer控件.写入如下代码:Private Sub Form_load()'必要的初始化操作Timer1.in
假设知道三角形的三边长为a,b,c.程序如下:#include#includedoublearea(doublea,doubleb,doublec){doublearea=0,s=0;s=(a+b+c
新三角形的底是原三角形底的:1+10%, 新三角形的高是原三角形高的:1+10%, 新三角形的面积是原三角形面积的:(1+10%)×
拜托,这么多输入你就用列表啦,用那么多textbox,你不累我看得都累.还有,你要求的是什么尽量用数学的方式表达出来,有图更好至于你的a5d6的问题,是因为你的是字符串运算而不是数值运算,转换一下类型
#include#defineN10intgetsum(intn,inta[][N])//要求的通用函数{inti,j,sum=0;for(i=0;i
//很简单.采纳吧#include#defineN10longfun(int(*num)[10],intn){inti,j;longs=1;for(i=0;i
我HI你吧,等一下