Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
靠!TMD每个字母前面居然还有3个空格,这是什么格式啊!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator