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 |
Output Limit Exceed??#include<stdio.h> int kab(int m) {return (m>0)?m:-m;} main() {int t,dx,dy,k,q,c; char a[5]={'\0','\0','\0','\0','\0'}; scanf("%d",&t); while(t) { gets(a); printf("%s\n",a); dx=kab(a[0]-a[3]);dy=kab(a[1]-a[4]); if(!dx&&!dy) printf("0 0 0 0\n"); else {k=(dx>dy)?dx:dy;q=(dx==dy||!dx||!dy)?1:2;c=(!dy||!dx)?1:2;} printf("%d %d %d ",k,q,c); if(!(dx-dy)%2) printf("Inf\n"); else if(dx==dy) printf("1\n"); else printf("2\n");a={'\0'}; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator