結果
| 問題 | No.656 ゴルフ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-06 05:03:30 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 23,424 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 12:17:17 |
| 合計ジャッジ時間 | 806 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d",&score);
| ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main(void) {
int i,j,score,scoreSum,scoreArray[9];
double power;
scanf("%d",&score);
for (i = 0; i < 9; i++) {
power = pow(10,i);
scoreArray[i] = (int)(score/power)%10;
}
for (j = 0; j < 9; j++) {
if (scoreArray[j] != 0) {
scoreSum += scoreArray[j];
}else {
scoreSum += 10;
}
}
printf("%d\n",scoreSum);
return 0;
}