首页 新闻 会员 周边 捐助

用VB编写以下....帮帮忙

0
悬赏园豆:100 [已关闭问题]
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 14pt;" lang="EN-US"><span style="font-family: Times New Roman;">(1)题 </span></span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman';">输入一批成绩</span><span style="font-size: 14pt;" lang="EN-US"><span style="font-family: Times New Roman;">(</span></span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman';">假设</span><span style="font-size: 14pt;" lang="EN-US"><span style="font-family: Times New Roman;">0</span></span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman';">&le;成绩&le;</span><span style="font-size: 14pt;" lang="EN-US"><span style="font-family: Times New Roman;">100</span></span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman';">,输入时以负数为结束标志,至少有一个成绩</span><span style="font-size: 14pt;" lang="EN-US"><span style="font-family: Times New Roman;">)</span></span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman';">,求其中的最高分与最低分之差。</span><span style="font-size: 14pt;" lang="EN-US"></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US">Min = 999: Max = -1 : Score = InputBox("</span><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;">输入一个成绩:<span lang="EN-US">")</span></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US">&nbsp;&nbsp;&nbsp; Do</span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Score &lt; Min Then Min = Score</span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Score &gt; Max Then Max = Score</span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Score = InputBox("</span><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;">输入一个成绩:<span lang="EN-US">")</span></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US">&nbsp;&nbsp;&nbsp; Loop While&nbsp;<strong>&nbsp;<span style="text-decoration: underline;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></strong></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US"><strong></strong></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US"><strong></strong></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US"><strong><span style="text-decoration: underline;">2题</span></strong><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;">计算</span><span style="font-family: &quot;Times New Roman&quot;; font-size: 14pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;" lang="EN-US">1~100</span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;">之间的偶数之和?</span></span></p> <p class="MsoNormal" style="text-align: left; line-height: 150%; margin: 0cm 15pt 0pt; word-break: break-all; mso-pagination: widow-orphan;" align="left"><span style="line-height: 150%; font-family: 宋体; color: black; font-size: 14pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体;" lang="EN-US"><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;">3题<span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;">输入要购买的</span><span style="font-family: &quot;Times New Roman&quot;; font-size: 14pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;" lang="EN-US">3</span><span style="font-family: 宋体; font-size: 14pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;">种商品的单价和数量,输出所用的总金额。要求输入和输出均使用文本框</span></span></span></p>
jayue2005的主页 jayue2005 | 初学一级 | 园豆:85
提问于:2009-11-20 22:44
< >
分享
其他回答(1)
0

仅给你第二题,希望你能好好学VB

2.

DIM S AS Integer

FOR INT I=1 to 100 

  IF I MOD 2=0 THEN

    S=S+I

  END IF

NEXT

PRINT S

醉春风 | 园豆:225 (菜鸟二级) | 2009-11-20 23:33
0

(1)Score>0

(2)dim s as interger

s=((1+100)*50-50)/2

(解释:1加到100是50个奇数和50个偶数,50个偶数和必然比奇数和多50,得到如下方程:2x+50=sum(1+.....+100)

(3)

dim count as interger

dim i as interger

i=1,count=0

DO

count=count+Inputbox("输入单价:")*Inputbox("输入数量:")

i++

loop while i<=3

outputbox("总金额:"+count)

dege301 | 园豆:2825 (老鸟四级) | 2009-11-21 13:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册