package test;
public class Main {
public static void main(String[] args) throws Exception{
int beg = 200000;
int k = 0;
int i;
for(i = beg; i > 0; i--){
if(is2(beg - i)) {
k += 100;
} else {
k--;
}
}
System.out.println(Integer.toString(k));
System.out.println("Finish!");
}
public static boolean is2(long l) {
if (l <= 3) {
if (l > 1) {
return true;
}
return false;
} else if (l % 2 == 0 || l % 3 == 0) {
return false;
} else {
int i = 5;
while (i * i <= l) {
if (l % i == 0 || l % (i + 2) == 0) {
return false;
}
i += 6;
}
return true;
}
}
}
public native String stringFromJNI2(int i);
package net.bluelotus.tomorrow.easyandroid;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.wnagzihxa1n.demo.R;
public class MainActivity extends AppCompatActivity {
static {
System.loadLibrary("lhm");
}
public native String stringFromJNI2(int number);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Toast.makeText(this, stringFromJNI2(1616384), Toast.LENGTH_LONG).show();
Log.i("wnagzihxa1n", stringFromJNI2(1616384));
}
}
03-28 09:02:21.066 25084-25084/com.wnagzihxa1n.demo I/wnagzihxa1n: Y0vAr3TimerMa3te7