Search found 4 matches

by enochcheng
Mon Jan 10, 2005 11:52 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 52498

what's wrong with this program?
please help...thx
by enochcheng
Sun Jan 09, 2005 7:35 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189313

fixed
thx a lot
by enochcheng
Sat Jan 08, 2005 9:20 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 52498

102

how about this why i can't be done? #include "stdio.h" main() { int max,i,j,total=0,bin[9],final[]={0,0,0},checka[]={0,0,1},checkb[]={1,2,2}; char maxbin[3]={8,8,8},binname[]="BCG"; while(scanf("%d%d%d%d%d%d%d%d%d",&bin[0],&bin[2],&bin[1],&bin[3],&bin[5],&bin[4],&bin[6],&bin[8],&bin[7])==9) { total=...
by enochcheng
Sat Jan 08, 2005 9:20 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189313

100

What's wrong with it? thx #include "stdio.h" main() { int i,n,start,end,c,max; while(scanf("%d%d",&start,&end)==2) { max=0; for(i=start;i<=end;i++) { n=i; c=0; while(1) { c++; if(n==1) break; if(n%2==1) n=3*n+1; else n/=2; } if(c>max) max=c; } printf("%d %d %d\n",start,end,max); } }

Go to advanced search