結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー hamhamhamham
提出日時 2017-06-13 13:47:07
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 241 bytes
コンパイル時間 1,140 ms
コンパイル使用メモリ 11,984 KB
実行使用メモリ 12,388 KB
最終ジャッジ日時 2023-08-26 17:08:23
合計ジャッジ時間 2,262 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
12,316 KB
testcase_01 WA -
testcase_02 AC 8 ms
12,296 KB
testcase_03 AC 7 ms
12,336 KB
testcase_04 AC 7 ms
12,272 KB
testcase_05 AC 8 ms
12,328 KB
testcase_06 AC 7 ms
12,340 KB
testcase_07 AC 9 ms
12,304 KB
testcase_08 AC 16 ms
12,276 KB
testcase_09 AC 23 ms
12,268 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 7 ms
12,260 KB
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(empty($line_n)) {
        break;
    }
    $sum += $line_n;
}


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