QB / QB64 Discussion Forum      Other Subforums, Links and Downloads
 

 Return to Index  

missed the last lines

June 22 2011 at 7:38 AM
David  (no login)


Response to up to 100

 

CLS
DIM n(0 TO 10) AS LONG
nn = 27
DIM p(nn)
DATA 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101
FOR j = 1 TO nn - 1
READ p(j)
NEXT j
n(0) = 1
PRINT n(0)
FOR i = 2 TO 100
FOR k = 1 TO nn - 1
s = LOG(i) / LOG(p(k))
IF ABS(INT(s + .00001) - s) < .00001 THEN EXIT FOR
NEXT k
IF k < nn THEN
c = 0
FOR m = 0 TO 10
n(m) = n(m) * p(k) + c
c = n(m) \ 10000000
n(m) = n(m) - c * 10000000
NEXT m
END IF
y$ = ""
FOR m = 10 TO 0 STEP -1
x$ = RIGHT$("000000000" + LTRIM$(STR$(n(m))), 7)
IF x$ = "0000000" THEN x$ = ""
y$ = y$ + x$
NEXT m
b = LEN(y$)
FOR mm = 1 TO b
IF MID$(y$, mm, 1) <> "0" THEN EXIT FOR
NEXT mm
PRINT RIGHT$(y$, b - mm + 1); " "; i
NEXT i


 
 Respond to this message   
Responses

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement