Search found 5 matches

by hacker
Tue Sep 06, 2005 9:53 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317910

THANKS A LOT

THANKS A LOT.

It Worked...
by hacker
Tue Sep 06, 2005 6:37 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317910

Still doesnot work.


#include<stdio.h>
int main()
{
unsigned long int a,b,c,d, loopvar, cycle_length=1, max_cycle_length=1, i;

while (scanf("%ld %ld",&a,&b)==2){

printf("%ld %ld",a, b);

if(a>b)
{
a=a+b;
b=a-b;
a=a-b;
}

loopvar = (b-a) + 1;
c = a;
d = a;

for(i=1; i<=loopvar; i ...
by hacker
Tue Sep 06, 2005 12:24 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317910

And how do i do that.

I really dun know how to do it.
by hacker
Sun Sep 04, 2005 5:09 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317910

Can't get

This time it accepted the code.
But said wrong answer.

I checked again.
My code is handling all the test cases


#include<stdio.h>
int main()
{
unsigned long int a,b,c,d, loopvar, cycle_length=1, max_cycle_length=1, i;

scanf("%ld %ld",&a,&b);

printf("%ld %ld",a, b);

if(a>b)
{
a=a+b;
b=a ...
by hacker
Sun Sep 04, 2005 12:38 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317910

Can't DEBUG

I am getting the desired output for all the test-cases.
But it is not accepting my problem..

#include<stdio.h>
int main()
{
unsigned long int a,b,c,d, loopvar, cycle_length=1, max_cycle_length=1, i;

clrscr();

scanf("%ld",&a);
scanf(" %ld",&b);

printf("%ld %ld",a, b);

if(a>b)
{
a=a+b ...

Go to advanced search