Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfset timestart=now()>
- <cfset xAry = arraynew(1)>
- <cfloop from='1' to="35000" index='i'>
- <cfset xAry[i] = true>
- </cfloop>
- <cfset i = 2>
- <cfloop condition='i le arraylen(xAry) / 2'>
- <cfif xAry[i] is true>
- <cfset x = i>
- <cfloop condition='i*x le arraylen(xAry)' >
- <cfset xAry[x*i] = false>
- <cfset x++>
- </cfloop>
- </cfif>
- <cfset i++>
- </cfloop>
- <cfset timeend=now()>
- <cfoutput>started: #timeformat(timestart, 'hh:mm.ss tt')# - ended: #timeformat(timeend, 'hh:mm.ss tt')#<br /></cfoutput>
- <cfoutput>
- <cfloop from='1' to='#arraylen(xAry)#' index='i'>
- <cfif xAry[i] is true> #numberformat(i,'999,999,999,999,999')# </cfif>
- </cfloop>
- </cfoutput>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement