Примеры программ на языке QBASIC

DIM S(28)
FOR A1 = 0 TO 9: FOR A2 = 0 TO 9: FOR A3 = 0 TO 9
  S(A1 + A2 + A3) = S(A1 + A2 + A3) + 1
NEXT A3: NEXT A2: NEXT A1
FOR K = 0 TO 27: N = N + S(K) * S(K): NEXT K
PRINT "Количество счастливых билетов = "; N
END