Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1.     public void lerArray(int[] array,int n){
  2.         int TAM = array.length;
  3.         int[] clone = new int[TAM];
  4.         for(int i = 0;i < TAM;++i){
  5.             clone[i] = array[(Math.abs((TAM*n)-n))%TAM];//TAM-n é o tamanho.
  6.             --n;
  7.         }
  8.         for(int y = 0;y < clone.length;++y)System.out.print(clone[y]);
  9.     }
  10.     public void lerArray2(int[] array,int n){
  11.         int TAM = array.length;
  12.         int[] clone = new int[TAM];
  13.         for(int i = 0;i < TAM;++i){
  14.             clone[i] = array[n % TAM];//TAM-n é o tamanho.
  15.             ++n;
  16.         }
  17.         for(int y = 0;y < clone.length;++y)System.out.print(clone[y]);
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement