Submission #16786

#TimeUsernameProblemLanguageResultExecution timeMemory
16786kdh9949카드 (GA8_card)C++98
Compilation error
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); }

Compilation message (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);
                  ^