摘要:
1. 按螺旋方式打印矩阵: Print in spiral form as shown belowFor n=23 20 1For n=34 3 25 0 16 7 8For n=415 14 13 124 3 2 115 0 1 106 7 8 9 一看到这个题目应该比较容易想到递归,不过这个递归里面有些细节需要特别注意,代码如下: #include <iostream>#include <math.h>usingnamespace std;struct Position{ Position(int _x, int _y) { x = _x; y = _y;} int 阅读全文
posted @ 2012-11-25 13:07
做个不善的人
阅读(286)
评论(0)
推荐(0)
浙公网安备 33010602011771号