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:请大家看看为什么错了?老是出现编译错误。谢谢了!

Posted by NobleQiao at 2006-02-16 13:13:46 on Problem 1207
In Reply To:请大家看看为什么错了?老是出现编译错误。谢谢了! Posted by:y05dzz at 2006-01-27 17:09:54
> #include<iomanip.h>
> int find(int &n){
>  int i=0;
> while(1){
>    i++;
>    if(n==1)break;
>    else 
>    {
>       if(n%2==1)
>                {n=3*n+1;}
>       else n=n/2;
>     }
> }
>    return i;
> }
> int mian()------>应该是main()吧,呵呵
> {
>    int i,j,m=1,n;
>    cin>>i>>j;
>    cout<<i<<j;
>    while(n<j)
> {  
>    n=find(m);
>    m++;
>    if(n<i)continue;
> }  cout<<m-2<<endl;
>    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