Submission #7521

# Submission time Handle Problem Language Result Execution time Memory
7521 2014-08-10T12:05:19 Z tncks0121 카드 (GA8_card) C++
Compilation error
0 ms 0 KB
#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

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]