結果

問題 No.289 数字を全て足そう
ユーザー sironekotorosironekotoro
提出日時 2018-11-30 15:13:54
言語 Perl
(5.38.0)
結果
AC  
実行時間 10 ms / 1,000 ms
コード長 259 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 5,992 KB
最終ジャッジ日時 2023-09-09 06:28:51
合計ジャッジ時間 1,406 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,040 KB
testcase_01 AC 6 ms
4,920 KB
testcase_02 AC 5 ms
4,956 KB
testcase_03 AC 5 ms
5,268 KB
testcase_04 AC 5 ms
5,160 KB
testcase_05 AC 6 ms
5,024 KB
testcase_06 AC 5 ms
4,932 KB
testcase_07 AC 7 ms
5,532 KB
testcase_08 AC 7 ms
5,624 KB
testcase_09 AC 5 ms
5,180 KB
testcase_10 AC 6 ms
5,184 KB
testcase_11 AC 6 ms
5,392 KB
testcase_12 AC 8 ms
5,804 KB
testcase_13 AC 7 ms
5,372 KB
testcase_14 AC 8 ms
5,832 KB
testcase_15 AC 7 ms
5,688 KB
testcase_16 AC 6 ms
5,412 KB
testcase_17 AC 7 ms
5,556 KB
testcase_18 AC 8 ms
5,704 KB
testcase_19 AC 7 ms
5,464 KB
testcase_20 AC 6 ms
5,516 KB
testcase_21 AC 5 ms
5,176 KB
testcase_22 AC 7 ms
5,820 KB
testcase_23 AC 10 ms
5,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;
use v5.16;

# https://yukicoder.me/problems/783

# my $input = "1a2b3c4d5e6f7g8h90";
my $input = <>;
chomp $input;

my @a = split //, $input;

my $sum = 0;
for my $n (@a){
    if ($n =~ /\d/){
        $sum += $n;
    };
}

say $sum;
0