0% found this document useful (0 votes)
35 views1 page

Prima

Uploaded by

stan.lee19
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Prima

Uploaded by

stan.lee19
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

7/15/13

Printed code version produced by WordPress WP-SynHighlight plugin

1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 1 0 . 1 1 . 1 2 . 1 3 . 1 4 . 1 5 . 1 6 . 1 7 . 1 8 . 1 9 . 2 0 . 2 1 . 2 2 . 2 3 . 2 4 . 2 5 . 2 6 . 2 7 . 2 8 .

< ? p h p f u n c t i o nb i l a n g a n _ p r i m a ( $ l i m i t ){ $ p r i m a=a r r a y ( ) ; $ p r i m a _ a w a l=a r r a y ( 2 , 3 , 5 , 7 ) ; f o r( $ i = 2 ;$ i < = $ l i m i t ;$ i + + ) $ p r i m a [ $ i ]=t r u e ; f o r e a c h( $ p r i m a _ a w a la s$ a w a l ){ f o r( $ i = 2 * $ a w a l ;$ i < = $ l i m i t ;$ i + = $ a w a l ){ $ p r i m a [ $ i ]=f a l s e ; } } f o r e a c h( $ p r i m aa s$ b i l a n g a n = > $ s t a t u s ){ i f( $ s t a t u s )e c h o" $ b i l a n g a n" ; } } $ s t a r t = m k t i m e ( ) ; b i l a n g a n _ p r i m a ( 1 0 0 0 0 0 0 ) ; $ f i n i s h = m k t i m e ( ) ; $ r e s u l t = $ f i n i s h $ s t a r t ; e c h o" < b r > T i m e :$ r e s u l ts e c o n d s " ; ? >

1/1

You might also like