結果

問題 No.289 数字を全て足そう
ユーザー ant2357ant2357
提出日時 2016-03-26 21:07:58
言語 PHP
(8.3.4)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 180 bytes
コンパイル時間 3,545 ms
コンパイル使用メモリ 31,760 KB
実行使用メモリ 31,324 KB
最終ジャッジ日時 2024-04-16 21:04:13
合計ジャッジ時間 1,908 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
31,284 KB
testcase_01 AC 41 ms
30,872 KB
testcase_02 AC 41 ms
31,324 KB
testcase_03 AC 42 ms
30,964 KB
testcase_04 AC 41 ms
31,316 KB
testcase_05 AC 41 ms
30,908 KB
testcase_06 AC 41 ms
31,084 KB
testcase_07 AC 41 ms
31,256 KB
testcase_08 AC 41 ms
31,012 KB
testcase_09 AC 42 ms
30,876 KB
testcase_10 AC 42 ms
31,004 KB
testcase_11 AC 42 ms
31,000 KB
testcase_12 AC 42 ms
30,740 KB
testcase_13 AC 41 ms
31,104 KB
testcase_14 AC 42 ms
31,072 KB
testcase_15 AC 42 ms
30,880 KB
testcase_16 AC 42 ms
31,140 KB
testcase_17 AC 41 ms
31,316 KB
testcase_18 AC 42 ms
30,968 KB
testcase_19 AC 41 ms
31,140 KB
testcase_20 AC 41 ms
30,912 KB
testcase_21 AC 41 ms
30,684 KB
testcase_22 AC 42 ms
31,204 KB
testcase_23 AC 42 ms
31,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$input = trim(fgets(STDIN));
$ans = 0;

$input = preg_replace('/[^0-9]/', '', $input);

for ($i = 0; $i < strlen($input); $i++) {
	$ans += $input[$i];
}

echo ($ans.PHP_EOL);
0