09/06/19 07:58:05
>>240
% Prolog
% 述語 同一要素ならび/3 は事実上の組込述語ですね
t240(N) :-
for(N,M,1),t240_1(M),N=1.
t240_1(N) :-
同一要素ならび(*,L,N),
concat_atom([N|L],S),
write_formatted('%t\n',[S]).
同一要素ならび(_要素,List,Length) :-
length(List,Length),
同一要素ならび(_要素,List) .
同一要素ならび(_,[]).
同一要素ならび(A,[A|R]) :-
同一要素ならび(A,R).