Submission #508

# Submission time Handle Problem Language Result Execution time Memory
508 2013-02-28T06:39:15 Z ohchanghun25 최댓값 (tutorial2) C++
Compilation error
0 ms 0 KB
#include<stdio.h>

int main()
{
	int N, arr[100];
	int i,Max=-1;
	
	scanf("%d",&N);

	for(i=0;i<N;i++)
		scanf("%d",&arr[i]);

	Max=arr[0];

	for(i=1;i<N;i++)
		if(Max<arr[i])
			Max=arr[i];

	printf("%d",Max);
}

Compilation message

tutorial2.cpp: In function 'int main()':
tutorial2.cpp:8:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
tutorial2.cpp:11:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
/tmp/ccdsKpnm.o: In function `main':
tutorial2.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccGGQhy7.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccGGQhy7.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `GetMax(int, int*)'
collect2: ld returned 1 exit status