Results 1 to 2 of 2
  1. #1
    jow620 is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Exclamation Can someone help me pls??

    Can someone explane me why you get as result of this process: true, true, false, true?

    Java Code:
    public class PaliMod {
    	private int delta;
    	public PaliMod(int mnD) {
    		delta = mnD;
    	}
    	private boolean check(int [] rij,int d) {
    		if (d >= rij.length - d - 1) return true;
    		if ((rij[d]- rij[rij.length-d-1]) % delta == 0) 
    				return check(rij,d+1);
    		return false;
    	}
    	public boolean check(int [] eenRij) {
    		return check(eenRij,0);
    	}
    	public static void main(String[] args) {
    		int [] rij1 = {1,67,13,2,14};
    		int [] rij2 = {1};
    		int [] rij3 = {1,130};
    		PaliMod gen = new PaliMod(13);
    		System.out.println(gen.check(rij1));
    		System.out.println(gen.check(rij2));
    		System.out.println(gen.check(rij3));
    		System.out.println(new PaliMod(111).
    check(new int[]{1,2,3,4,448,336,224,112}));
    	}
    }
    Java Code:
    --------------------Configuration: <Default>--------------------
    true
    true
    false
    true
    
    Process completed.
    Last edited by jow620; 01-10-2009 at 10:17 PM.

  2. #2
    dragonlinux is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •