Submission #23050

#TimeUsernameProblemLanguageResultExecution timeMemory
23050model_codeTarifa (COCI16_tarifa)C++11
50 / 50
0 ms1116 KiB
#include <cstdio> using namespace std; const int MAXN = 110; int x, n; int a[MAXN]; int main() { scanf("%d%d", &x, &n); int sum = 0; for(int i=0; i<n; i++){ scanf("%d", a+i); sum += a[i]; } printf("%d\n", x * (n + 1) - sum); return 0; }

Compilation message (stderr)

tarifa.cpp: In function 'int main()':
tarifa.cpp:12:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &x, &n);
                          ^
tarifa.cpp:16:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", a+i);
                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...