Hi,
First, and this is a style thing... I hate it when people place the brace { on the same line as the expression... just does not look nice to me.
Adjusted:
int main ()
{
const int MAX_NUM = 60;
const int MAX_CALLS = 41;
int num_calls [MAX_CALLS];
int k = 0;
for(int i=1; i<=MAX_NUM; i++)
{
num_calls[i] = 0;
cout<< series(i) <<endl;
if ((series (i)) < MAX_CALLS)
{
num_calls[series (i)]++;
}
else
{
k++;
}
}
for(int l=1; l<MAX_CALLS; l++)
{
cout<< l << " " << num_calls[l] <<endl;
}
cout<< "and " << k << "numbers have series length greater than 40" <<endl;
} I notice that you declare main() to be of type INT, and you do not return any number to the OS. I wonder if that is hanging you up.
I would have tried, but you didn't bring along your whole program, and I wasn't about to code it further. I couldn't compile because I had no idea what series is, and at 11:30pm, I am not to creative.
Christian
kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57