Submission #16786

# Submission time Handle Problem Language Result Execution time Memory
16786 2015-09-29T04:39:23 Z kdh9949 카드 (GA8_card) C++
Compilation error
0 ms 0 KB
#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);
}

Compilation message

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);
                  ^