遍历法、穷举法、枚举法
S=0
FOR A=0 TO 9
FOR B=0 TO 9
FOR C=0 TO 9
FOR D=0 TO 9
IF A+B=C*D THEN
S=S+A*1000+B*100+C*10+D
END IF
NEXT D
NEXT C
NEXT B
NEXT A
PRINT S
END
遍历法、穷举法、枚举法
S=0
FOR A=0 TO 9
FOR B=0 TO 9
FOR C=0 TO 9
FOR D=0 TO 9
IF A+B=C*D THEN
S=S+A*1000+B*100+C*10+D
END IF
NEXT D
NEXT C
NEXT B
NEXT A
PRINT S
END