結果

問題 No.18 うーさー暗号
ユーザー
提出日時 2016-01-12 23:38:49
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 32,480 KB
実行使用メモリ 32,736 KB
最終ジャッジ日時 2023-10-19 22:56:05
合計ジャッジ時間 1,460 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
32,448 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$alp = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");

$in = trim(fgets(STDIN));

$que = str_split($in);

foreach($alp as $num => $alp1){
    foreach($que as $numQue => $alpQue){
        $numQue_Mi = $numQue +1;
        if($alpQue === "A"){
            echo "Z";
        }
        if($alp1 === $alpQue){
            $mi = $num - $numQue_Mi; 
            echo $alp[$mi];
        }
    }
}

echo "\n";
0