Mae向きなブログ

Mae向きな情報発信を続けていきたいと思います。

平成26年度春季基本情報午後問9

平成26年度春季 基本情報技術者試験(FE)の午後問題9は、

  • 印字したときに単語が行末で切れないようにテキストを編集してファイルに出力するプログラムに関する

問題でした。

f:id:rahaema:20190203164100p:plain

プログラム例(h26h_fe_pm9.c)

設問1のプログラムを以下に示します。

実行結果

in.txt

The    Infomation   Technology   Engineers
   Examination   was  first  administered  in 1969. In 1970,
 it became a national examination.
       Since its commencement, the examination has played
    an important role   in the development of IT    engineers.

実行

$ gcc h26h_fe_pm9.c && ./a.out in.txt out.txt
$ cat out.txt
The    Infomation   Technology   Engineers
   Examination   was  first  administered  in
1969. In 1970,
 it became a national examination.
       Since its commencement, the examination has
 played
    an important role   in the development of IT
  engineers.