09/06/05 07:17:06
>>88
% Prolog (4/4)
整数入力検査(N,L) :-
integer(N),
N >= 0,
N =< 100,
not(member(N,L)),!.
整数入力検査(N,L) :-
not(integer(N)),
write('整数ではありません! 再入力が必要です。\n'),
!,fail.
整数入力検査(N,L) :-
integer(N),
not((N >= 0,N =< 100)),
write('整数範囲が正しくありません! 再入力が必要です。\n'),
!,fail.
整数入力検査(N,L) :-
integer(N),
N >= 0,N =< 100,
member(N,L),
write('既出の整数です! 再入力が必要です。\n'),
!,fail.