結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー hamhamhamham
提出日時 2017-06-13 13:49:19
言語 PHP
(8.3.4)
結果
AC  
実行時間 76 ms / 3,000 ms
コード長 261 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 12,056 KB
実行使用メモリ 12,380 KB
最終ジャッジ日時 2023-08-26 17:08:33
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
12,320 KB
testcase_01 AC 6 ms
12,252 KB
testcase_02 AC 6 ms
12,320 KB
testcase_03 AC 6 ms
12,316 KB
testcase_04 AC 6 ms
12,304 KB
testcase_05 AC 6 ms
12,244 KB
testcase_06 AC 6 ms
12,276 KB
testcase_07 AC 7 ms
12,336 KB
testcase_08 AC 14 ms
12,256 KB
testcase_09 AC 22 ms
12,320 KB
testcase_10 AC 61 ms
12,324 KB
testcase_11 AC 65 ms
12,344 KB
testcase_12 AC 65 ms
12,320 KB
testcase_13 AC 69 ms
12,240 KB
testcase_14 AC 68 ms
12,332 KB
testcase_15 AC 69 ms
12,272 KB
testcase_16 AC 76 ms
12,324 KB
testcase_17 AC 7 ms
12,296 KB
testcase_18 AC 5 ms
12,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
//1行目を読み込む
$line1 = trim(fgets(STDIN));
//2行目以降を読み込む
$sum = 0;
while (true) {
    $line_n = trim(fgets(STDIN));
    if($line_n === null || $line_n === "" ) {
        break;
    }
    $sum += $line_n;
}

printf("{$sum}\n");
0