Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int crible_array[] = new int [100];
- void setup(){
- crible_array[0] = crible_array[1];
- for(int i = 2; i<crible_array.length;i++){
- crible_array[i] =1;
- }
- for(int i = 2; i<sqrt(crible_array.length); i++){
- if(crible_array[i] == 1){
- for(int j = i*i; j<crible_array.length; j += i){
- crible_array[j] = 0;
- }
- }
- }
- for(int i = 0; i<crible_array.length; i++){
- if(crible_array[i] == 1){
- println(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement