結果
問題 |
No.9014 テストの合計点と平均点
|
ユーザー |
|
提出日時 | 2021-03-31 05:35:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 2,627 ms |
コンパイル使用メモリ | 191,740 KB |
最終ジャッジ日時 | 2025-01-20 01:03:40 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d,%d,%d", &a, &b, &c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int a,b,c; scanf("%d,%d,%d", &a, &b, &c); int sum = a+b+c; float ave = (float)sum / 3; cout << "合計点:" << sum << endl; cout << "平均点:" << fixed << setprecision(1) << ave << endl; return 0; }