当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > vbs解答一道初中数学题i,x,y

VBScript
VBS教程:函数-LoadPicture 函数
VBS教程:函数-Len 函数
VBS教程:函数-Left 函数
VBS教程:函数-LCase 函数
VBS教程:函数-LBound 函数
VBS教程:函数-Join 函数
VBS教程:函数-IsObject 函数
VBS教程:函数-IsNumeric 函数
VBS教程:函数-IsNull 函数
VBS教程:函数-IsEmpty 函数
VBS教程:函数-IsDate 函数
VBS教程:函数-IsArray 函数
VBS教程:函数-Int、Fix 函数
VBS教程:函数-InStrRev 函数
VBS教程:函数-InStr 函数
VBS教程:函数-InputBox 函数
VBS教程:函数-Hour 函数
VBS教程:函数-Hex 函数
VBS教程:函数-GetRef 函数
VBS教程:函数-GetObject 函数

VBScript 中的 vbs解答一道初中数学题i,x,y


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 79 ::
收藏到网摘: n/a

一道初中数学题,用VBS找到答案
未知数~i 加上100成为一个完全平方数~X,i 加上168成为另外一个完全平方数~Y,i,x,y都是正整数,求出i,x,y
---------------------------------------------------
n=0
msg1="未知数~i 加上100成为一个完全平方数~X"+chr(10)
msg2="i 加上168成为另外一个完全平方数~Y"+chr(10)+"i,x,y都是正整数"+chr(10)
l=inputbox (msg1+msg2+"请输入i的搜索范围,用来找到i,x,y.1~?:")
if IsNumeric(l) then
msg4=l+" 中搜索答案"
for i=1 to l
x=int(sqr(i+100))
y=int(sqr(i+168))
if x^2=i+100 and y^2=i+168 then
msg3="那么 i,X,Y分别是:"+cstr(i)+","+cstr(x)+","+cstr(y)
msgbox msg1+msg2+msg3,vbokonly,msg4
n=1
exit for
end if
next
if n=0 then
msg3="那么 没有找到合适的答案!"
msgbox msg1+msg2+msg3,vbokonly, msg4
end if
else
msg3="那么 没有找到合适的答案!"
msgbox msg1+msg2+msg3,vbokonly, "搜索范围有问题!"
end if
-------------------------------
结论是156,16,18