제출 #16786

#제출 시각아이디문제언어결과실행 시간메모리
16786kdh9949카드 (GA8_card)C++98
컴파일 에러
0 ms0 KiB
#include<stdio.h>

int k,m,n,sum;

int main()
{
  scanf("%d",&n);
  for(int i=0;i<n;i++){
  	scanf("%d",&k);
    m=m<k?k:m;
    s+=k;
  }
  printf("%d",s-m);
}

컴파일 시 표준 에러 (stderr) 메시지

card.cpp: In function ‘int main()’:
card.cpp:11:5: error: ‘s’ was not declared in this scope
     s+=k;
     ^
card.cpp:13:15: error: ‘s’ was not declared in this scope
   printf("%d",s-m);
               ^
card.cpp:7:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&n);
                 ^
card.cpp:9:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&k);
                  ^