返回狼盟编程首页
编程搜索 [狼盟旧档]
论坛统计


请输入搜索关键字:
├─◆ 狼盟首页 > 查看贴子 > 详细信息

楼主

[原创]求助用QBasic


本人是初学者 寻找帮助 10万火急  谁能用QBasic 帮我解1个方程啊?   ax2+bx+c=0 2是X的2次方  求2个根~~  我先谢谢各位了。。。偶菜鸟。。 1





tianyuan008 [ 1 楼 ]
2006-03-10 00:04:00
dim a,b,c,d as doubleINPUT "The first factor a=" ; aINPUT "The second factor b="; bINPUT "The const c=";cif a=0 then   print "Error"  endend ifendd=b^2-4*a*cif d>=0 then   print "the first root is: "; (-b+sqr(d))/(2*a)   print "the second root is:"; (-b-sqr(d))/(2*a)else    print "the first root is:"; -b/(2*a);   print "+i(";   print sqr(-d)/(2*a);   print ")"   print "the second root is:"; -b/(2*a);   print "-i(";   print sqr(-d)/(2*a);   print ")"end ifend 

32119046 [ 2 楼 ]
2006-03-10 00:06:00
谢谢了 爱死你 

32119046 [ 3 楼 ]
2006-03-10 00:17:00
专业人士  这种命令print "the first root is "The first factor a=" ; a "The second factor b="; b"The const c=";c "+i(";  print ")"不用还有解法吗?