Submission #1796

#TimeUsernameProblemLanguageResultExecution timeMemory
1796caffeinism7최댓값 (tutorial2)C++98
Compilation error
0 ms0 KiB
#include <stdio.h> int GetMax(int N, int A[]){ int max = 0; for(int i=1; i<=N; i++){ if(max < A[i]){ max = A[i]; } } return max; } int main(void){ int N, A[3000]; scanf("%d", &N); for(int i = 1; i <= N; i ++){ scanf("%d", &A[i]); } printf("%d", GetMax(N, A)); return 0; }

Compilation message (stderr)

tutorial2.cpp: In function 'int main()':
tutorial2.cpp:18:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
tutorial2.cpp:21:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
/tmp/ccg2G76y.o: In function `main':
tutorial2.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc63nEKJ.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: ld returned 1 exit status