Search found 2 matches

by fesoliveira
Sun Apr 03, 2011 8:09 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320000

Re: 100

take a look at my code...

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

main() {

int x, y, j, temp, big, diff, n, i=0, cycles[100000];
int func(i);

scanf("%d %d", &x, &y);

if (!((x==1) && (x==y))) {


if (x<y) {

j = x;

do {

cycles[i] = func(j);
i++;
j++;

} while(j<=y);

big = cycles[0 ...
by fesoliveira
Sun Apr 03, 2011 7:03 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320000

Re: If you get WA in problem 100, read me before post!

there is my code:

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

main() {

int x, y, j, temp, big, diff, n, i=0, cycles[100000];

scanf("%d %d", &x, &y);

if (!((x==1) && (x==y))) {


if (x<y) {

j = x;

do {

cycles[i] = func(j);
i++;
j++;

} while(j<=y);

big = cycles[0];
diff = y - x ...

Go to advanced search