結果
問題 |
No.476 正しくない平均
|
ユーザー |
|
提出日時 | 2017-03-10 15:00:17 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 243 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 07:49:03 |
合計ジャッジ時間 | 1,038 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 7 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d %d",&n,&a); | ^~~~~~~~~~~~~~~~~~~~ main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&x[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ int i,a,A=0,n,x[10]; scanf("%d %d",&n,&a); for(i=0;i<n;i++){ scanf("%d",&x[i]); A=A+x[i]; } if( (double)(a) == ( (double)(A) / (double)(n) )) printf("YES"); else printf("NO"); return 0; }