[ create a new paste ] login | about

Link: http://codepad.org/eFP00j1s    [ raw code | output | fork ]

박정욱 - C++, pasted on Apr 13:
//객체지향 2012/04/13 1번

#include<iostream>

using namespace std;


int get_max(int a, int b)
{
	int result;
	result = a > b ? a:b;
	return result;
};

int main()
{
	int nums[10]={20,32,24,34,67,86,134,65,39,142};
	int i,max;
	
	max = nums[0];
	for(i=1; i < 11 ; i++)
	{
		max = get_max(max,nums[i-1]);
		cout <<"step " << i << ": "<< max << endl;
	}
	
	return 0;
}


Output:
1
2
Line 13: error: extra ';'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: