Last active
February 15, 2016 09:14
-
-
Save nitaking/82b498dbdd51c2547fef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Here your code ! | |
// 出力文字列 | |
$print = ""; | |
$input = trim(fgets(STDIN)); | |
$days = str_replace(array("\r\n","\r","\n"), '', $input); | |
$days = explode(" ", $days); | |
// コマンドライン引数処理 | |
for($count = 0; $count < count($days); $count++){ | |
$print .= $days[$count]; | |
// 最後の引数は"/"を付与しない | |
if ($count < count($days)-1 ) { | |
$print .= "/"; | |
} else { | |
$print .= "\n"; | |
} | |
} | |
print($print); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment