登录

Writing and amending algorithms

Error

A ← 0
B ← 0
C ← 100
OUTPUT "Enter your ten values"
REPEAT
	INPUT X
	IF X > B
		THEN B ← X
	ENDIF
    IF X < C
		THEN C ← X
	ENDIF
	A ← A + 1
UNTIL A = 10
OUTPUT B, C

Right

OUTPUT "Enter your ten values"
INPUT X
A ← X
B ← X
\C ← 100
REPEAT
	INPUT X
	IF X > B
		THEN B ← X
	ENDIF
    IF X < C
		THEN C ← X
	ENDIF
	A ← A + 1
UNTIL A = 9
OUTPUT B, C
登录