Search found 5 matches

by mklein49
Tue Sep 24, 2002 8:27 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318193

Well, you were right. I made the correction and the program was accepted.
by mklein49
Tue Sep 24, 2002 8:19 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318193

Wouldn't this,
[cpp]while(!(cin.eof()))
{
cin >> i >> j;[/cpp]

workt the same as
[cpp]while(cin >> i >> j)[/cpp]
by mklein49
Tue Sep 24, 2002 8:18 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318193

oops
by mklein49
Mon Sep 23, 2002 3:48 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318193

I'm still getting an error. I modified my cycle algorithm to be recursive, too. I noticed that on a couple of numbers, ie 113383, if I try to caclulate the cycles, the number will be greater than 2^32. So, I'm not sure what to do.

[cpp]
/* @JUDGE_ID: 100 C++ */
/* @begin_of_source_code */

#include ...
by mklein49
Mon Sep 23, 2002 2:01 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318193

More 100 troubles

Could somebody look at this code and tell me what the problem is? I can't seem to find anything wrong.

[cpp]

/* @JUDGE_ID: 100 C++ */
/* @begin_of_source_code */

#include <iostream.h>
#include <stdio.h>


int cycle(int n);

int main()
{
int i, j, count, temp, n, max;

count = 0;
while(!(cin ...

Go to advanced search