The Problem statement asks us to compute cycle length of EVERY number between two input numbers. Hence, two inputs.
The program compiles perfectly my end and at the judge's end(website) with...
Type: Posts; User: neeha_khan
The Problem statement asks us to compute cycle length of EVERY number between two input numbers. Hence, two inputs.
The program compiles perfectly my end and at the judge's end(website) with...
Yes I have rewritten the program with proper functions, without VLA, which is not posted here now. Thanks.
I have found the error. The mistake is definitely not a compilation or presentation error, as I had mentioned before, There probably is some input for which I may not be getting the right output..
...
I made some modifications and wrote this now:
//110101 The 3n + 1 Problem
# include <iostream>
# include <fstream>
using namespace std;
int main()
The above program is only for 1 set of input.
The catch is here... "The input will consist of a series of pairs of integers i and j, one pair of integers per line."
But now how do I know when to...
Here it is:
//110101 The 3n + 1 Problem
# include <iostream>
using namespace std;
int main()
{
int i,j,k,x,n1,n,m=909,maxcount; //x=index of counter, n=no fo elements in counter,...
Yes it does. And there is a separate section/ count for "presentation errors" on their site, which is 0.
There probably is some input for which I may not be getting the right output, just maybe..
Thanks, but I already tried the single-run program. Didn't work :(
@laserlight
The site provides for a separate section/ count for compilation errors. There are 0 compilation errors.
@killme
Yes I am sorry I haven't presented a neat code here. And regarding...
This is the Problem Statement:
The 3n + 1 Problem
Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If
n is even, divide by 2. If n is odd, multiply by...