• <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>

            我希望你是我獨(dú)家記憶

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

            URAL1656

            Posted on 2008-11-02 13:47 Hero 閱讀(240) 評(píng)論(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 }
            国产亚洲色婷婷久久99精品91| 人妻中文久久久久| 国产午夜精品理论片久久影视| 欧洲人妻丰满av无码久久不卡| 久久精品人人做人人爽97 | 99久久亚洲综合精品网站| 99久久国产综合精品成人影院| 亚洲一区精品伊人久久伊人 | 久久婷婷五月综合色99啪ak | 国产精品久久久久影院嫩草| 亚洲国产成人久久精品影视| 人妻无码久久精品| 91久久精品无码一区二区毛片| 无码国内精品久久人妻麻豆按摩 | 婷婷五月深深久久精品| 日本免费一区二区久久人人澡| 人人妻久久人人澡人人爽人人精品 | 日韩精品无码久久一区二区三| 久久免费的精品国产V∧| 久久中文精品无码中文字幕| 久久久久高潮毛片免费全部播放| 久久综合九色综合久99| 久久国产一区二区| 久久精品国产亚洲AV香蕉| 久久国产亚洲精品| 久久久久无码精品国产app| 久久se精品一区精品二区| 亚洲色婷婷综合久久| 一本大道久久东京热无码AV| 久久艹国产| 久久综合给合综合久久| 国内精品久久久久久久亚洲| 精品久久久久久国产91| 精品久久久久久久久午夜福利| 亚洲级αV无码毛片久久精品| 一本综合久久国产二区| 亚洲日韩欧美一区久久久久我| 欧美亚洲日本久久精品| 亚洲欧美一级久久精品| 久久精品中文字幕大胸| 性做久久久久久久|