螺旋打印2D数组

//一破题付出血的代价   多思考!
public static void offer(int [][]a){
int left=,right=a.length-,low=,high=a[].length-;
while(low<=high){
for(int i=left;i<=right;i++){//
System.out.print(a[left][i]+" ");
}
low++;
for(int i=low;i<=high;i++){//
System.out.print(a[i][right]+" ");
}
right--;
for(int i=right;i>=left;i--){//
System.out.print(a[high][i]+" ");
}
high--;
for(int i=high;i>=low;i--){//
System.out.print(a[i][left]+" ");
}
left++; } }
上一篇:安装和配置SVN服务器Subversion、客户端TortoiseSVN和Visual Studio插件AnkhSvn


下一篇:构建基于WinRT的WP8.1 App 01:页面导航及页面缓存模式