結果
問題 | No.656 ゴルフ |
ユーザー |
![]() |
提出日時 | 2025-03-11 09:10:09 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 257 bytes |
コンパイル時間 | 535 ms |
コンパイル使用メモリ | 25,472 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-11 09:10:11 |
合計ジャッジ時間 | 1,231 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s",result); | ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> void main(void){ int score = 0; char result[100] = "a"; scanf("%s",result); for(int i = 0 ; i < 9 ; i++){ if(result[i] == '0'){ score += 10; }else{ score += result[i] - '0'; } } printf("%d",score); }