いろんな言語で宿題スレ 第三編at TECH
いろんな言語で宿題スレ 第三編 - 暇つぶし2ch554:デフォルトの名無しさん
10/02/01 15:54:09
>>547
% Prolog

program :-
  user_parameters([FileIn,FileOut]),
  open(FileIn,read,Input,[type(binary)]),
  open(FileOut,write,Output),
  get_byte(Input,C),
  free1(0,Input,Output,C),
  close(Output),
  close(Input).

free1(_,_,_,-1) :- !.
free1(16,Input,Output,C) :-
  write(Output,'\n'),
  free1(0,Input,Output,C),!.
free1(M,Input,Output,C) :-
  free1(M,Input,Output,C) :-
  N進数(16,C,A),
  write(Output,A),
  get_byte(Input,C2),
  M2 is M + 1,
  free1(M2,Input,Output,C2).

% N進数/3の定義は URLリンク(nojiriko.asia) 参照


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch