제출 #80531

#제출 시각아이디문제언어결과실행 시간메모리
80531pzdbaTarifa (COCI16_tarifa)C++14
50 / 50
2 ms848 KiB
#include <bits/stdc++.h>
using namespace std;
int a[105];
int main(){
	int x, n, a;
	scanf("%d%d", &x, &n);
	int ans = 0;
	for(int i=1;i<=n;i++){
		scanf("%d", &a);
		ans += x;
		ans -= a;
	}
	printf("%d\n", ans+x);
}

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

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