Submission #9145

#TimeUsernameProblemLanguageResultExecution timeMemory
9145carl111최댓값 (tutorial2)C++98
Compilation error
0 ms0 KiB
#include <stdio.h> int GetMax(int m, int arr2[]) { int i; int swap; swap=arr2[0]; for(i=0; i<m; i++) { if(arr2[i]>swap) swap = arr2[i]; } return swap; }; int main(void) { int n,i; int arr[100]; scanf("%d",&n); for(i=0; i<n; i++) arr[i]=0; for(i=0; i<n; i++) { scanf("%d",&arr[i]); } i=GetMax(n,arr); printf("%d",i); return 0; }

Compilation message (stderr)

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