제출 #7521

#제출 시각아이디문제언어결과실행 시간메모리
7521tncks0121카드 (GA8_card)C++98
컴파일 에러
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; }

컴파일 시 표준 에러 (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]