Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- private static int count = 0;
- private static boolean isSosu(int num1, int num2){
- if(num1 == num2){
- return true;
- }
- if( (num1 % (num2)) == 0){
- return false;
- }else{
- return isSosu(num1,num2 + 1);
- }
- }
- public static void main(String[] args) {
- for(int i = 2; i <= 1000; i++){
- if(isSosu(i,2)){
- System.out.println("ODD :" + i);
- count++;
- }
- }
- System.out.println(count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement