1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. 發(fā)autodesk矩陣題答案$autodesk$

        時間:2020-11-10 18:57:53 筆試題目 我要投稿

        發(fā)autodesk矩陣題答案$autodesk$

          


        #include "iostream"
        using namespace std;

        #define RIGHT 1
        #define DOWN 2
        #define LEFT 3
        #define UP 4

        int judge(int step, int walk, int flag)
        {
        if( walk < step )return flag;
        switch(flag)
        {
        case RIGHT:
        return DOWN;
        case DOWN:
        return LEFT;
        case LEFT:
        return UP;
        case UP:
        return RIGHT;
        }
        }

        void matrix(int N)
        {
        int length = N * N;
        int *p = new int[length];
        int flag = RIGHT;
        int step = N;
        int count = 0;
        int walk = -1;
        for(int i = 0 ; i < length ; i )
        {
        walk = 1;
        int newflag = judge(step , walk , flag);

        if(flag != newflag)
        {
        count = 1;
        flag = newflag;
        walk = 0;
        if( (count 1) % 2 == 0 )
        {
        step -= 1;
        }
        }


        switch(flag)
        {
        //right
        case RIGHT:
        if(i == 0)
        p[i] = 0;
        else
        p[i] = p[i - 1] 1;
        break;
        //down

        case DOWN:
        p[i] = p[i - 1] N;
        break;
        //left
        case LEFT:
        p[i] = p[i - 1] - 1;
        break;
        //up
        case UP:
        p[i] = p[i - 1] -N;
        }

        }

        int *tmp = new int[length];

        for(int j = 0; j < length; j )
        {
        tmp[p[j]] = j 1;
        }

        for(j = 0; j < length; j )
        {
        cout << tmp[j] << " ";
        if( ((j % N) == (N - 1)) )cout << "
        ";
        }

        }



        void main()
        {
        matrix(7);
        system("pause");
        }

        【發(fā)autodesk矩陣題答案$autodesk$】相關(guān)文章:

        腦筋急轉(zhuǎn)彎36題內(nèi)附答案11-14

        華為公司SWOT矩陣分析08-20

        小學(xué)應(yīng)用題入門題及答案10-17

        小學(xué)應(yīng)用題答案10-12

        小學(xué)選擇題應(yīng)用題及答案10-14

        游戲開發(fā)中的矩陣初探08-29

        智商推理題及答案11-25

        小學(xué)應(yīng)用題及答案10-08

        小學(xué)應(yīng)用題和答案10-08

        小學(xué)應(yīng)用題附答案10-08

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>