Search found 3 matches

by masachutee
Fri Sep 09, 2005 5:02 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318350

Thank a lot , chunyi81
I have read Fadia's problems but did't carefully notice the answer of angga888.
by masachutee
Fri Sep 09, 2005 4:17 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318350

can anyone help me! with prob#100

Can anyone help me with problem#100 Vol.I

my code is (via C++)
*******************
using namespace std;
#include <iostream>
int main(){
long int i,j,k,cl,l;
long int max=0;
cin>>i>>j;

for( k=i;k<=j;k++){
cl=1;
l=k;
while(l!=1){
cl+=1;
if(l%2 !=0) l=l*3+1;
else l=l/2;
}
if(cl>max ...
by masachutee
Fri Sep 09, 2005 4:12 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318350

problem# 100

Can anyone help me with problem#100 Vol.I

my code is (via C++)
*******************
using namespace std;
#include <iostream>
int main(){
long int i,j,k,cl,l;
long int max=0;
cin>>i>>j;

for( k=i;k<=j;k++){
cl=1;
l=k;
while(l!=1){
cl+=1;
if(l%2 !=0) l=l*3+1;
else l=l/2;
}
if(cl>max) max ...

Go to advanced search