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 |
code BUG..In Reply To:狂汗啊。。 用C++ WA,用G++就AC,怎么回事啊。 晕死了。 服务器BUG? Posted by:orangelegend at 2007-12-16 23:20:49 > 代码如下: 高手指点啊。 > 怎么会这样。。。 > > #include <iostream.h> > #include<stdio.h> > #include <string.h> > short flag[35][35]; > int main() > { > > int i,j,k,n,x,y; > char str; > scanf("%d",&n); > for (k = 1; k <= n; k++) > { > scanf("%d%d",&x,&y); > memset(flag,0,sizeof(flag)); > while(cin>>str) > { > if(str == 'E') > { > flag[y - 1][x] = 1; > x++; > } > else if (str == 'W') > { > flag[y][x - 1] = 1; > x--; > } > else if (str == 'N') > { > flag[y][x] = 1; > y++; > } > else if (str == 'S') > { > flag[y - 1][x - 1] = 1; > y--; > } > else break; > > } > printf("Bitmap #%d\n",k); > for (i = 31; i >= 0; i--) > { > for (j = 31; j >= 0; j--) > if (flag[i][31 - j] == 1) > printf("X"); > else printf("."); > printf("\n"); > } > 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