Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- int [] arr= {5, 50, 3, 42, 18, 16, 8, 30, 44}; // Array
- menorD l = new menorD();
- menorD.MinD(arr);
- }
- }
- public class menorD {
- static int arr_zise;
- public static void minD (int [] arr) {
- arr_zise = arr.length;
- int i, j;
- int minD=0;
- for(i=0;i<arr_zise; i++) {
- for(j=0;j<arr_zise; j++) {
- if(arr[i]!=arr[j]) {
- minD=arr[i]-arr[j];
- System.out.print(" i="+ arr[i]+ " j="+ arr[j]+ " minD es: "+Math.abs(min));
- System.out.println();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement