[1] 授業単元:プログラム演習
[2] 問題文(含コード&リンク):
英文が格納されているファイルe-text.txtを開き、読み込んだデータから
改行を全て取り除いた上で各行が第一引数で与えた数になるように整形し、
その結果をwordwrap.txtへ書き出すプログラムを作成せよ。
改行を取り除く時、文末の単語と次の行の単語が繋がらないように、必要に
応じて空白を挿入すること。また、行頭に空白や ’,’および '. 'が来ても
構わないとする。
例えば、以下のファイル内容に対して引数に20を与えたとき、wordwrap.txtは
以下のようになる。
<内容>
the constitution of japan(november 3, 1946).
we, the japanese people, acting through our duly
elected representatives in the national diet,
determined that we shall secure for ourselves

<wordwrap.txt>
the constitution o
f japan(november 3,
1946). we, the japa
nese people, acting
through our duly ele
cted representatives
in the national die
t, determined that w
e shall secure for o
urselves