| ||||||||||
| 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 | |||||||||
Re:拉了半天,终于出来了In Reply To:拉了半天,终于出来了 Posted by:wy54224 at 2011-01-28 16:32:45 #include <stdio.h>
int main(){
int m,n,i,j,c,s;
scanf("%d%d",&m,&n);
for(i=0;i<m;++i){
for(j=0;j<n;++j){
c=i<j?i:j;
c=c>m-1-i?m-1-i:c;
c=c>n-1-j?n-1-j:c;
s=2*c*(m+n-2*c);
if(i==c)s+=j-c;
else if(n-1-j==c)s+=n-3*c+i-1;
else if(m-1-i==c)s+=m+2*n-5*c-3-j;
else s+=2*(m+n)-7*c-4-i;
printf(" %c",'A'+(s%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