Search found 1 match

by dipu008
Sun Jun 28, 2015 10:52 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318253

Re: 100 - The 3n + 1 problem

I have posted this code and got wrong answer. What is the problem here? Thanks in advance.
The code is in ANSI C

#include <stdio.h>

int f(int i);

int main()
{
int num1, num2, n, i, j, h;
while(scanf("%d %d", &num1, &num2) == 2){
n = 0;
for(i=num1; i<=num2; i++){
j = f(i);
if(n < j) {
n ...

Go to advanced search