• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            我希望你是我獨家記憶

            一段永遠封存的記憶,隨風而去
            posts - 263, comments - 31, trackbacks - 0, articles - 3
               :: 首頁 :: 新隨筆 ::  :: 聚合  :: 管理

            URAL1656

            Posted on 2008-11-02 13:47 Hero 閱讀(238) 評論(0)  編輯 收藏 引用 所屬分類: 代碼如詩--ACM
             1 // 1656 C++ Accepted 0.015 129 KB URAL
             2 
             3 #include <stdio.h>
             4 #include <stdlib.h>
             5 #include <string.h>
             6 
             7 const int size = 100 ;
             8 int data[size] ;
             9 int out[size][size] ;
            10 
            11 int inn ;
            12 
            13 int cmp( const void *a, const void *b )
            14 {
            15     return *(int *)b - *(int *)a ;
            16 }
            17 
            18 void input()
            19 {
            20     int maxi = inn * inn ;
            21     forint i=1; i<=maxi; i++ )    scanf( "%d"&data[i] ) ;
            22 
            23     qsort( data+1, maxi, sizeof(data[1]), cmp ) ;
            24     /*
            25     printf( "**************************\n" ) ;
            26     for( int i=1; i<=maxi; i++ ) printf( "%d\n", data[i] ) ;
            27     printf( "**************************\n" ) ;
            28     */
            29 }
            30 
            31 void process()
            32 {
            33     int midrow = ( 1+inn ) / 2 ; int midcol = ( 1+inn ) / 2 ;
            34     int pdata = 1 ;//data[]指針
            35 
            36     out[midrow][midcol] = data[pdata++] ;
            37     forint c=midcol-1; c>=1; c-- )    out[midrow][c] = data[pdata++] ;
            38     forint c=midcol+1; c<=inn; c++ )    out[midrow][c] = data[pdata++] ;
            39     forint r=midrow-1; r>=1; r-- )    out[r][midcol] = data[pdata++] ;
            40     forint r=midrow+1; r<=inn; r++ )    out[r][midcol] = data[pdata++] ;
            41 
            42     forint r=midrow-1; r>=1; r-- )
            43     {
            44         forint c=midcol-1; c>=1; c-- )    out[r][c] = data[pdata++] ;
            45         forint c=midcol+1; c<=inn; c++ )    out[r][c] = data[pdata++] ;
            46     }
            47     forint r=midrow+1; r<=inn; r++ )
            48     {
            49         forint c=midcol-1; c>=1; c-- )    out[r][c] = data[pdata++] ;
            50         forint c=midcol+1; c<=inn; c++ )    out[r][c] = data[pdata++] ;
            51     }
            52 
            53     forint i=1; i<=inn; i++ )
            54     {
            55         forint j=1; j<=inn; j++ )
            56         {
            57             printf( "%d "out[i][j] ) ;
            58         }
            59         printf( "\n" ) ;
            60     }
            61 }
            62 
            63 int main()
            64 {
            65     while( scanf( "%d"&inn ) != EOF )
            66     {
            67         input() ;
            68 
            69         process() ;
            70 
            71         //output() ;
            72     }
            73 
            74     return 0 ;
            75 }
            18禁黄久久久AAA片| 国产精品伦理久久久久久| 无码人妻久久一区二区三区免费 | 香蕉久久av一区二区三区| 久久99亚洲网美利坚合众国| 久久久久四虎国产精品| 思思久久精品在热线热| 久久这里只有精品久久| 久久99热这里只有精品66| 久久噜噜电影你懂的| 久久久国产亚洲精品| 国产精品午夜久久| 久久人妻少妇嫩草AV无码专区| 久久午夜无码鲁丝片午夜精品| 精品综合久久久久久888蜜芽| 香蕉99久久国产综合精品宅男自 | 久久综合九色综合97_久久久| 国产精品久久久久免费a∨| 免费国产99久久久香蕉| 久久久精品人妻一区二区三区蜜桃 | 久久天天躁狠狠躁夜夜躁2014| 四虎国产精品免费久久久 | 久久久中文字幕| 久久91精品国产91久久小草 | 伊人久久大香线蕉av不变影院| 亚洲成人精品久久| 久久人爽人人爽人人片AV| 久久精品国产免费观看三人同眠| 久久国产影院| 日本久久中文字幕| 久久五月精品中文字幕| 国产 亚洲 欧美 另类 久久 | 午夜不卡久久精品无码免费| 精品无码人妻久久久久久 | 99久久精品无码一区二区毛片| 久久er99热精品一区二区| 久久久亚洲欧洲日产国码二区 | 国产激情久久久久影院小草| 久久se精品一区精品二区| 久久九九青青国产精品| 久久精品国产欧美日韩|