Submission #151713

#TimeUsernameProblemLanguageResultExecution timeMemory
151713geon0407최댓값 (tutorial2)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int arr[11]; int n, i; int main(void) { int ans = 0; scanf("%d", &n); for(i=0;i<n;i++) { int in; scanf("%d", &in); ans = max(ans, in); } printf("%d\n", ans); return 0; }

Compilation message (stderr)

tutorial2.cpp: In function 'int main()':
tutorial2.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
tutorial2.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &in);
         ~~~~~^~~~~~~~~~~
/tmp/cc0GX6Hg.o: In function `main':
tutorial2.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccfTMSwq.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccfTMSwq.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `GetMax(int, int*)'
collect2: error: ld returned 1 exit status