prolog_1.pl



%%%%----MUESTRA LAS TABLAS DE MULTIPLICAR---%%%%%%%%%%5
lista_1([], _):-!.
lista_1([H|_], A):-
	operacion(H, A),
	fail.
lista_1([_|T], A):-
	!, lista_1(T, A).


operacion(_, []):- !.
operacion(A, [H|_]):-
	B is H * A,
	sformat(Salida, '~w * ~w = ~w', [A, H, B]),
	write(Salida), write('\n'),
	fail.
operacion(A, [_|T]):-
	!, operacion(A, T).


presenta:-
	lista_1([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
	write('F I N').
:- presenta.