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 |
为什么WA,求指导#include<stdlib.h> #include<stdio.h> int main() { int max(int m,int n); char x1,x2,y1,y2; int a,b,c,d,n,i,xx,yy; scanf("%d",&n); getchar(); for(i=1;i<=n;i++) { d=0; scanf("%c%c %c%c",&x1,&y1,&x2,&y2); getchar();// xx=x1-x2;yy=y1-y2; if(xx==0&&yy==0) {printf("0 0 0 0\n"); continue;} a=max(abs(xx),abs(yy)); if(xx==yy||xx==0||yy==0) b=1; else b=2; if(x1==x2||y1==y2) c=1; else c=2; if(xx==yy) d=1; if(d==1) printf("%d %d %d %d\n",a,b,c,d); else if(abs(xx-yy)%2) printf("%d %d %d Inf\n",a,b,c); else printf("%d %d %d 2\n",a,b,c); } system("pause"); return 0; } int max(int m,int n) { if(m>=n) return m; else return n; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator