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

为什么经常compile error?明明在自己机子上没问题

Posted by baga at 2009-03-22 22:46:32 on Problem 1657
代码:请帮忙看一下
#include"stdio.h"
#include"math.h"
int main()
{ int nCases,i;
while(scanf("%d",&nCases)){
   for(i=0;i<nCases;i++){
    char begin[5],end[5];
     scanf("%s%s",begin,end);
     int x,y;
     x=abs(begin[0]-end[0]);
     y=abs(begin[1]-end[1]);
     if(x==0&&y==0)printf("0 0 0 0\n");
     else{
       if(x<y)
        printf(" %d",y);
       else 
        printf(" %d",x);  //王的步数
       if(x==y||x==0||y==0) 
        printf(" 1");
       else
        printf(" 2");      //后的步数
       if(x==0||y==0) 
        printf(" 1");
       else
        printf(" 2");       //车的步数
       if(abs(x-y)%2!=0)
        printf(" Inf\n");
       else if(x==y)
             printf(" 1\n");
            else
             printf(" 2\n");       //象的步数
}
}
}
   return 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