제출 #23050

#제출 시각아이디문제언어결과실행 시간메모리
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;
}

컴파일 시 표준 에러 (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...