Is there something about CODE tags you don't understand? If not, you can either ask or read those words on the back of the input box for information.
The project states "Test it with a main program that takes as input an integer count followed by that many values." Where did you read an integer count? Doesn't getline() read a string, not a list of integers? You need to use a loop to read (and output) your numbers.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Well the first question is, can you solve this problem using regular iteration?
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
instead of line 9, you should use a for loop to get the values for the integer array list...
and as WaltP said you have not read an integer count...it should have been read before line 8...
line 10 too is incorrect...you dont display an integer array like that...you have to use the for loop there...
tracethepath
Junior Poster in Training
54 posts since Jul 2007
Reputation Points: 8
Solved Threads: 4
n again you have to call the function max between lines 10 and 11...or otherwise from where you will get the value for "n"??
tracethepath
Junior Poster in Training
54 posts since Jul 2007
Reputation Points: 8
Solved Threads: 4
line 15, you have declare i again...that is not correct...and you have placed a semi colon after for loop there...so line 16 will run just once and will not give the desired output...
and line 29 should not be there...instead it should be
static int maximum=l[0];
otherwise as the function is called again and again maximum value will be initialised to present l[count]...and the maximum value till that point will be lost...
tracethepath
Junior Poster in Training
54 posts since Jul 2007
Reputation Points: 8
Solved Threads: 4