結果

問題 No.289 数字を全て足そう
ユーザー shiCanoko_oshiCanoko_o
提出日時 2019-05-17 22:37:44
言語 Perl
(5.38.2)
結果
AC  
実行時間 9 ms / 1,000 ms
コード長 261 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 5,384 KB
実行使用メモリ 7,428 KB
最終ジャッジ日時 2023-10-17 07:28:08
合計ジャッジ時間 1,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
5,512 KB
testcase_01 AC 3 ms
5,512 KB
testcase_02 AC 4 ms
5,512 KB
testcase_03 AC 4 ms
5,512 KB
testcase_04 AC 4 ms
5,512 KB
testcase_05 AC 5 ms
5,964 KB
testcase_06 AC 4 ms
5,836 KB
testcase_07 AC 9 ms
6,732 KB
testcase_08 AC 8 ms
6,708 KB
testcase_09 AC 5 ms
5,916 KB
testcase_10 AC 5 ms
6,108 KB
testcase_11 AC 7 ms
6,404 KB
testcase_12 AC 9 ms
6,968 KB
testcase_13 AC 7 ms
6,380 KB
testcase_14 AC 9 ms
6,996 KB
testcase_15 AC 7 ms
6,556 KB
testcase_16 AC 6 ms
6,272 KB
testcase_17 AC 8 ms
6,644 KB
testcase_18 AC 9 ms
6,988 KB
testcase_19 AC 7 ms
6,576 KB
testcase_20 AC 7 ms
6,648 KB
testcase_21 AC 3 ms
5,640 KB
testcase_22 AC 9 ms
6,932 KB
testcase_23 AC 9 ms
7,428 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

my $str = <>;
chomp ($str);

my @str = split(//, $str);

my $num;
my @numbers;

for my $word(@str){
    if($word =~ /[a-z]/){
        $num = 0;
    }else{
        push @numbers, $word;
    }
}

for my $numbers(@numbers){
    $num += $numbers
}

print "$num\n";
0