結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
tell0risa
|
| 提出日時 | 2015-10-18 02:55:11 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 1,000 ms |
| + 691µs | |
| コード長 | 362 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 29,440 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-24 03:19:19 |
| 合計ジャッジ時間 | 1,494 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s", moji);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void)
{
char moji[10001];
int i, j;
int temp = 0;
scanf("%s", moji);
for (i = 0; moji[i] != '\0'; i++)
{
}
for (j = 0; j <= i; j++)
{
if (moji[j] <= '9' && moji[j] >= '0')
{
temp += moji[j] - 0x30;
}
}
printf("%d\n", temp);
}
tell0risa