摘要: 本文参考该作者文章当作编程笔记:作者:Hawstein出处:http://hawstein.com/posts/ctci-solutions-contents.html一.Q: 一张图像表示成NxN的矩阵,图像中每个像素是4个字节,写一个函数把图像旋转90度。 你能原地进行操作吗?(即不开辟额外的存储空间)思路:见:http://hawstein.com/posts/1.6.htmlCODE: 1 #include 2 #define N 4 3 #define exch(A,B) {int t=A;A=B;B=t;} 4 void transpose(int s[][N]) 5 { 6 .. 阅读全文
posted @ 2014-03-01 08:56 哈士奇.银桑 阅读(128) 评论(0) 推荐(0) 编辑