Submission #717849

#TimeUsernameProblemLanguageResultExecution timeMemory
717849EntityPlantt최댓값 (tutorial2)C++14
Compilation error
0 ms0 KiB
#include <cstdio> #include <algorithm> int main() { int n, i = 0; scanf("%d", &n); int a[n]; while (i < n) { scanf("%d", a + i++); } printf("%d", *std::max_element(a, a + n)); return 0; }

Compilation message (stderr)

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