标签:offer sys log print class bsp nbsp ++ blog
//一破题付出血的代价 多思考!
public static void offer(int [][]a){ int left=0,right=a.length-1,low=0,high=a[0].length-1; while(low<=high){ for(int i=left;i<=right;i++){//123 System.out.print(a[left][i]+" "); } low++; for(int i=low;i<=high;i++){//69 System.out.print(a[i][right]+" "); } right--; for(int i=right;i>=left;i--){//87 System.out.print(a[high][i]+" "); } high--; for(int i=high;i>=low;i--){//45 System.out.print(a[i][left]+" "); } left++; } }
标签:offer sys log print class bsp nbsp ++ blog
原文地址:http://www.cnblogs.com/KingIceMou/p/7531198.html