結果

問題 No.656 ゴルフ
ユーザー motimoti
提出日時 2018-05-14 23:33:37
言語 Perl
(5.38.2)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 5,120 KB
最終ジャッジ日時 2023-09-10 20:46:54
合計ジャッジ時間 1,077 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,800 KB
testcase_01 AC 5 ms
4,776 KB
testcase_02 AC 5 ms
5,120 KB
testcase_03 AC 5 ms
4,776 KB
testcase_04 AC 5 ms
4,904 KB
testcase_05 AC 5 ms
4,976 KB
testcase_06 AC 5 ms
4,772 KB
testcase_07 AC 5 ms
4,920 KB
testcase_08 AC 5 ms
5,092 KB
testcase_09 AC 5 ms
5,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use utf8;
use warnings;

if ($0 eq __FILE__) {
  my $line = <STDIN>;
  my $val = 0;
  foreach my $ch (split //, $line) {
    if ($ch eq "\n") {
      last;
    }
    if ($ch eq "0") {
      $val += 10;
    } else {
      $val += $ch;
    }
  }
  printf("%d\n", $val);
}
0