結果

問題 No.656 ゴルフ
ユーザー suppy193
提出日時 2023-09-09 20:20:27
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 919 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 12:53:52
合計ジャッジ時間 1,681 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%s", s);
      |         ^~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main(void){
	
	int i;
	char s[10];
	int score = 0;
	
	scanf("%s", s);
	for(i = 0;i < 9;i++){
		if(s[i] == '0'){
			score += 10;
		}
		else{
			score += s[i] - '0';
		}
	}
	printf("%d\n", score);

	return 0;
}
0