結果

問題 No.476 正しくない平均
ユーザー Haijinn
提出日時 2017-01-29 14:16:42
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 21,760 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 23:09:41
合計ジャッジ時間 1,103 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 15 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
   15 |         scanf("%d",&x[i]);
      |                ~^  ~~~~~
      |                 |  |
      |                 |  long long int *
      |                 int *
      |                %lld
main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 | scanf("%lld%lld",&n,&a);
      | ^~~~~~~~~~~~~~~~~~~~~~~
main.c:15:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |         scanf("%d",&x[i]);
      |         ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void)
{
long long  n;
long long a;
long long x[10];
int i;
int d=0;
double k;
scanf("%lld%lld",&n,&a);
for(i=0;i<n;i++){
	
	
	scanf("%d",&x[i]);
	
	d+=x[i];
}
k=d/n*0.1;
if(k==a){
	printf("YES\n");
	
	
	
	
}else{
	
	printf("NO\n");
}



	return 0;
}
0