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

请大家看看我的程序!

Posted by 11300528 at 2005-11-17 20:12:31 on Problem 1067
#include <stdio.h>
long equ(long j,long a)
{return(j==a?1:0);
}
main()
{long i=1,j=1,k=0,l,t,a,b;
 scanf("%d %d",&a,&b);
 k=a<b?a:b; t=k;
 for(;k>0;k--)
    {i=i+1,j=j+2;
     l=equ(j,t);
     if(l) break;
     i=i+1,j=j+1;
     l=equ(j,t);
     if(l) break;
     i=i+1,j=j+2;
     l=equ(j,t);
     if(l) break;
    }
 i=i+j;
 t=a>b?a:b;
 if(i==t)
    printf("%ld\n",l-1);
 else
    printf("%ld\n",l);

}
为什么总是"Wrong answer"呀?我感觉对呀.我是根据上边的讨论写的.

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