Search found 4 matches

by Austin
Sun Jun 27, 2004 11:33 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

I've modified my code:


#include<stdio.h>
#include<stdlib.h>


long function(long k);
int count;
void main()
{
long m,n,temp,maxCount,tempCount;
long i;

while(scanf("%ld %ld",&n,&m)!=0)

{ if(n>m)
{
temp=n;
n=m;
m=temp;

}

maxCount=function(n);
for(i=n+1;i<=m;i++)
{
tempCount ...
by Austin
Sat Jun 26, 2004 1:00 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

Thanks for the reply. I've simply changed the following thing

while(scanf("%d %d",&n,&m)!=EOF)

And the entire code is as follows:

/* @JUDGE_ID: 47052RM 100 C "3n+1 problem" */



#include<stdio.h>
#include<stdlib.h>


int function(int k);
int count;
main()
{
int m,n,i,temp,maxCount,tempCount ...
by Austin
Sat Jun 26, 2004 10:16 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

What's wrong in it? prob 100

Everytime i'm receiving this Wrong Answer reply including
"Your program has not solved the problem. It ran during 0.002 seconds."

#include<stdio.h>
#include<stdlib.h>


int function(int k);
int count;
void main()
{
int m,n,i,temp,maxCount,tempCount;

scanf("%d %d",&n,&m);


if(n>m)
{
temp ...
by Austin
Sat Jun 26, 2004 10:15 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

What's wrong in it?

Everytime i'm receiving this Wrong Answer reply including
"Your program has not solved the problem. It ran during 0.002 seconds."

#include<stdio.h>
#include<stdlib.h>


int function(int k);
int count;
void main()
{
int m,n,i,temp,maxCount,tempCount;

scanf("%d %d",&n,&m);


if(n>m)
{
temp ...

Go to advanced search