Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package itfkdup;
- /**
- *
- * @author Usuariomaq23
- */
- public class Itfkdup {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- int M[][] = {{7,6,15,4,3,2,1},{6,7,5,4,3,20,1},{1,6,7,40,3,2,1},{4,6,5,7,3,2,1},{1,6,5,4,3,2,7}};
- int x, y;
- int MU2[];
- for(x=0; x<M.length; x++)
- {
- MU2 = ordenar(x,M);
- for(y=0; y<MU2.length; y++)
- {
- System.out.print(MU2[y] + " ");
- }
- System.out.println();
- }
- }
- public static int[] ordenar(int x, int M[][])
- {
- int MU[];
- int y;
- for(y=0; y<M[x].length; y++)
- {
- }
- MU = new int[y];
- for(y=0; y<M[x].length; y++)
- {
- MU[y] = M[x][y];
- }
- int c, i=1, pos, t;
- c=MU.length;
- while(i>0)
- {
- i=0;
- c=c-1;
- pos=0;
- while(pos<c)
- {
- if(MU[pos]>MU[pos+1])
- {
- t=MU[pos];
- MU[pos] = MU[pos+1];
- MU[pos+1] = t;
- i++;
- }
- pos++;
- }
- }
- /*for(x=0; x<MU.length; x++)
- {
- System.out.println(MU[x]);
- }*/
- return MU;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement