結果

問題 No.656 ゴルフ
ユーザー PraiPrai
提出日時 2018-10-23 11:16:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 852 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 50,968 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-12 06:15:46
合計ジャッジ時間 1,129 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*A君の仕事はゴルフのスコア表の計算です。
ゴルフのスコアはボールを1回打つごとに1加算されます。
例えば、あるホールで4打打ったとすればスコア表に4と記載しスコアは4です。
例外として、10打以上打った場合にはスコア表に0と記載してスコアは10となります。
A君は9ホールぶんのスコア表を渡されるのでスコアの合計を計算しましょう。

なお、ゴルフというスポーツの性質上、0打でホールを終了することはありえません!
*/

#include<iostream>

using namespace std;

int main(){
	int score[9];
	int total=0;

	for (int i = 0; i < 9; ++i)
	{
		cin>>score[i];
	}


	for (int i = 0; i < 9; ++i)
	{
		if(score[i]<10){
			total=total+score[i];
		}else{
			total+=10;
		}

	}

	cout<<total<<endl;
}
0