Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:Output Limit Exceed??

Posted by cpp0600548054 at 2006-02-24 22:37:30 on Problem 1657
In Reply To:Output Limit Exceed?? Posted by:oxygen at 2005-10-19 21:04:02
> #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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator