結果

問題 No.476 正しくない平均
ユーザー Eclair1015
提出日時 2018-05-06 11:21:15
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-28 02:06:07
合計ジャッジ時間 971 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 15 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(){
	int n,a;
	int x[10];
	int i;
	int total;
	double ave;
	
	scanf("%d %d",&n,&a);
	
	for(i=0;i<n;i++){
		scanf("%d",&x[i]);
	}
	
	for(i=0;i<n;i++){
		total+=x[i];
	}
	ave=(total/n);
	
	if(ave==a){
		printf("YES");
	}else{
		printf("NO");
	}
	return 0;
}
0