Submission #19199

#TimeUsernameProblemLanguageResultExecution timeMemory
19199anrhks1212최댓값 (tutorial2)C++98
Compilation error
0 ms0 KiB
int GetMax(int N, int *A)
{
	int i=0, max=0;

	for (i = 0; i<N; i++)
	{
		cin >> A[i];
	}

	max = A[0];
	for (i = 0; i < N - 1; i++)
	{
		if (max < A[i + 1])
		{
			max = A[i + 1];
		}
	}
	return max;
}

Compilation message (stderr)

tutorial2.cpp: In function ‘int GetMax(int, int*)’:
tutorial2.cpp:7:3: error: ‘cin’ was not declared in this scope
   cin >> A[i];
   ^