<awangdev>204. Count Primes_1.java
public int countPrimes(int n) {
    	if (n <= 1) {
    		return 0;
    	}
    	boolean[] primes = new boolean[n]; 
    	for (int i = 2; i < primes.length; i++) {
    		primes[i] = true;
    	}

    	for (int i = 2; i * i < n; i++) {
			if (!primes[i]) {
				continue;
			}
    		for (int j = i * i; j < n; j += i) {
    			primes[j] = false;
    		}
    	}
    	int count = 0;
    	for (int i = 2; i < primes.length; i++) {
    		count += primes[i] ? 1 : 0;
    	}
    	return count;
    }
public int sample_funcname ( int var_0 ) {
  if ( var_0 <= 1 ) {
    return 0 ;
  }
  boolean [ ] var_4 = new boolean [ var_0 ] ;
  for ( int var_6 = 2 ;
  var_6 < var_4 . length ;
  var_6 ++ ) {
    var_4 [ var_6 ] = true ;
  }
  for ( int var_6 = 2 ;
  var_6 * var_6 < var_0 ;
  var_6 ++ ) {
    if ( ! var_4 [ var_6 ] ) {
      continue ;
    }
    for ( int var_8 = var_6 * var_6 ;
    var_8 < var_0 ;
    var_8 += var_6 ) {
      var_4 [ var_8 ] = false ;
    }
  }
  int var_9 = 0 ;
  for ( int var_6 = 2 ;
  var_6 < var_4 . length ;
  var_6 ++ ) {
    var_9 += var_4 [ var_6 ] ? 1 : 0 ;
  }
  return var_9 ;
}
