Submission #7521

#TimeUsernameProblemLanguageResultExecution timeMemory
7521tncks0121카드 (GA8_card)C++98
Compilation error
0 ms0 KiB
#include <stdio.h> int main() { int n, s = 0, m = -1; scanf("%d", &n); while(n--) { int x; scanf("%d", &x); s += x; if(x > m) m = x; } printf("%d\n", s-x); return 0; }

Compilation message (stderr)

card.cpp: In function 'int main()':
card.cpp:11:20: error: 'x' was not declared in this scope
card.cpp:5:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
card.cpp:7:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]