結果

問題 No.9014 テストの合計点と平均点
ユーザー koufu193
提出日時 2025-03-25 10:18:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 65,536 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2025-03-25 10:18:53
合計ジャッジ時間 1,582 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%d,%d,%d",&scores[0],&scores[1],&scores[2]);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
    int scores[3];
    scanf("%d,%d,%d",&scores[0],&scores[1],&scores[2]);
    int sum=scores[0]+scores[1]+scores[2];
    printf("合計点:%d\n平均点:%.1f",sum,((double)sum)/3);
    return 0;
}
0