会QBASIC语言得人进来帮我做到编程题?

来源:百度知道 编辑:UC知道 时间:2024/06/06 08:11:27
一共俩道题:

⑴求出45,21,-4,-7,5,-77,64,32,89,-85,53数据中得正数之和?
⑵任意输入三个数,打印输出最大得数。

1
data 45,21,-4,-7,5,-77,64,32,89,-85,53
dim a as integer
dim b as integer
b=0
for i=0 to 10
read a
if a>0 then
b=b+a
end if
next i

print b

2
dim a as integer
dim b as integer
dim c as integer
input a
input b
input c
if a<b then
a=b
end if

if a<c then
a=c
end if
print a

还有什么问题可以直接问我,给我留言或者到我的论坛上问都可以。
欢迎访问我的论坛:)
http://www.chinesebloger.com
期待您的支持:)

楼上的太难,看我的,简单一点的~!
DIM A(1 TO 10) 定义数组
FOR I = 1 TO 10
READ A(I)
DATA 45,21,-4,-7,5,-77,64,32,89,-85,53 给数组赋值
NEXT I
FOR I = 1 TO 10
IF A(I)>0 THEN S=S+A 条件判断
END IF
NEXT I
PRINT B

INPUT A
INPUT B
INPUT C
IF A > B AND A > C THEN MAX =A
END IF
IF B > A AND B