Guest User

Untitled

a guest
Jun 21st, 2010
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void main(String[] args){
  2.     List<Integer> l = new LinkedList<Integer>();
  3.     for(int i=1, size = Integer.valueOf(args[0]); i <= size; i++, Collections.reverse(l)){
  4.         if(i%2 == 0) l.add(0, i); else l.add(i);
  5.         System.out.println(Arrays.toString(l.toArray()).replaceAll(", ", "-").replaceAll("[\\[,\\]]", ""));
  6.     }
  7. }
RAW Paste Data