[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
【模範解答】 m@main=do s<-getLine;putStrLn(s#s);m s#(a:t)|s++t==t++s=[a]|0<1=a:s#t
【test.ml】 let f(x) = x * 2;; print_int(f(3));;
【実行結果】 user@localhost ~ $ ocamlc test.ml -o test user@localhost ~ $ ./test 6user@localhost ~ $