Submission #594518

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

Compilation message (stderr)

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