条件を満たす行を取り除く
Posted feedbacks - StandardML
手続き型で。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | fun rm_comment_line (rf::wf::[]) =
let
open TextIO
val r = openIn rf
val w = openOut wf
fun rm_comment_line' NONE = (closeIn r; closeOut w)
| rm_comment_line' (SOME x) = (
if String.isPrefix "#" x then () else output (w, x);
rm_comment_line' (inputLine r)
)
in
rm_comment_line' (inputLine r)
end
| rm_comment_line _ = ();
rm_comment_line (CommandLine.arguments ())
|


にしお
#3366()
Rating0/0=0.00
サンプル入力
サンプル出力[ reply ]