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

不要急着贴代码,没人回看的,你先去看下disscussion别人讨论的问题你注意了没有。。

Posted by richardxx at 2007-05-30 13:19:52
In Reply To:为什么一直都是 wrong answer?? 1207 有大牛能帮我看一下吗? Posted by:UESTCTurbo at 2007-05-30 12:56:45
> #include <stdio.h>
> int main()
> { int x[10],y[10],i,mark[10],max[10],n=0,z;
>   for (i=0;i<10;i++)
>      { x[i]=0;
>        y[i]=0;
>        mark[i]=0;
>        max[i]=0;
>      }
>    for(n=0;scanf("%d %d",&x[n],&y[n])!=EOF;n++)
>         {
> 
>          for (i=x[n];i<=y[n];i++)
>               {z=i;
>                mark[n]=0;
>                while(z!=1)
>                  {if ((float) z/2!=z/2) z=3*z+1;
>                   else z=z/2;
>                   mark[n]++;
>                  }
>                if (max[n]<mark[n]+1) max[n]=mark[n]+1;
> 
> 
>               }
> 
> 
>         }
>    for(i=0;i<=n-1;i++)
>       {printf("%d %d %d\n",x[i],y[i],max[i]);
>       }
>   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