void SpiralMatrix(int height, int width, int startNum, int startPos) { int** martix = new int* [height]; for (int i=0; i totalCnt) { break; } for (x=widthEnd-1; x>=round; x--) { *(*(martix+heightEnd)+x) = startNum++; } for (y=heightEnd-1; y>round; y--) { *(*(martix+y)+round) = startNum++; } } for (y=0; y