Submission #594519

#TimeUsernameProblemLanguageResultExecution timeMemory
594519ai4youej최댓값 (tutorial2)C11
Compilation error
0 ms0 KiB
#include <stdio.h> int main() { int n, ans = 0, k; scanf("%d", &n); while (n--) { scanf("%d", &k); ans = ans < k ? k : ans; } printf("%d", ans); }

Compilation message (stderr)

tutorial2.c: In function 'main':
tutorial2.c:5:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |   scanf("%d", &n);
      |   ^~~~~~~~~~~~~~~
tutorial2.c:7:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d", &k);
      |     ^~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cc8l2M6D.o: in function `main':
tutorial2.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccgJV8nB.o:grader.c:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccgJV8nB.o: in function `main':
grader.c:(.text.startup+0xaa): undefined reference to `GetMax'
collect2: error: ld returned 1 exit status