Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

靠!TMD每个字母前面居然还有3个空格,这是什么格式啊!

Posted by 201501060326 at 2016-02-29 21:18:54 on Problem 3752
#include <stdio.h>
char s[100][100];
int array[100][100];
int main()
{
    int x,y,m,n,k;
    scanf("%d%d",&m,&n);
    array[x=0][y=0]=k=1;
    while(k<m*n)
    {
        while(y+1<=n-1&&!array[x][y+1])
            array[x][++y]=++k;
        while(x+1<=m-1&&!array[x+1][y])
            array[++x][y]=++k;
        while(y-1>=0&&!array[x][y-1])
            array[x][--y]=++k;
        while(x-1>=0&&!array[x-1][y])
            array[--x][y]=++k;
    }
    for(x=0; x<m; x++)
    {
        for(y=0; y<n; y++)
        {
            printf("   %c",'A'+(array[x][y]-1)%26);
        }
        printf("\n");
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator