• <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 閱讀(240) 評論(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 }
            国产精品一久久香蕉国产线看观看 | 久久精品免费一区二区三区| 亚洲成色WWW久久网站| 久久天天躁狠狠躁夜夜网站| 99精品国产在热久久| 99久久国产免费福利| 欧美亚洲日本久久精品| 99久久精品免费看国产一区二区三区 | 无码任你躁久久久久久老妇App| 97久久国产露脸精品国产 | 久久se精品一区精品二区国产| 亚洲精品无码久久不卡| 久久99精品综合国产首页| 久久久久久极精品久久久| 中文字幕久久精品无码| 国产精品美女久久久久av爽| 日韩精品久久久久久免费| 久久精品国产WWW456C0M| 久久婷婷国产综合精品| 亚洲精品97久久中文字幕无码| 久久99精品国产自在现线小黄鸭 | 国产福利电影一区二区三区久久老子无码午夜伦不 | 99久久国产综合精品网成人影院 | 99久久夜色精品国产网站| 精品一二三区久久aaa片| 日韩精品无码久久一区二区三| 99久久国产热无码精品免费| 久久久久波多野结衣高潮| 久久99精品久久久久久9蜜桃| 久久精品国产久精国产思思| 亚洲欧美另类日本久久国产真实乱对白 | 99久久人妻无码精品系列 | 久久精品一区二区| 91精品国产综合久久精品| 伊人久久大香线蕉AV色婷婷色| 国产精品久久久香蕉| 中文字幕无码av激情不卡久久| 天堂无码久久综合东京热| 综合久久给合久久狠狠狠97色| 亚洲国产成人久久精品99 | www.久久精品|