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 tzy09 at 2009-03-16 12:29:42 on Problem 1207
for(i=a;i<=b;i++)
  {
    while(i!=1)
      {
        if(i%2==0) 
          {
            i=i/2;
            j++;
          }
        else
          {
           i=3*i+1;
           j++;
          }
       }
     if(max<j) max=j;
  }

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