#include using namespace std; /////////////////// メイン /////////////////// int main () { //////////////////// 入力 //////////////////// string s; cin >> s; //////////////// 出力変数定義 //////////////// int result = 0; //////////////////// 処理 //////////////////// s += ','; int n = 0; for (char c : s) { if (c!=',') { n *= 10; n += c-'0'; } else { result += n; n = 0; } } //////////////////// 出力 //////////////////// cout << "合計点:" << result << endl; cout << "平均点:" << fixed << setprecision(1) << (result*10)/3/10.0 << endl; //////////////////// 終了 //////////////////// return 0; }