Натуральное число n вывести все тройки чисел, сумма квадратов, которых равно число n — QBasic(Бейсик)

REM ВОТ РЕШЕНИЕ
DIM N AS LONG
DIM A AS LONG
DIM B AS LONG
DIM C AS LONG
DIM D AS LONG
CLS
INPUT "BBEDITE N:", N
LET D = SQR(N)
FOR A = 1 TO D
FOR B = A TO D
FOR C = B TO D
IF A^2+B^2+C^2=N THEN PRINT "A=",A,"B=",B,"C=",C
NEXT C
NEXT B
NEXT A
END

Leave a Comment