Так как язык не указан, приведу пример на SWI-Prolog.
Код:
read_int(Int) :- read(Int), integer(Int).split_int_by_numbers(0, []) :- !.split_int_by_numbers(N, [Number|Ints]) :- Number is mod(N, 10), RestN is div(N, 10), split_int_by_numbers(RestN, Ints).test_to_div(_, []).test_to_div(N, [Number|Ints]) :- mod(N, Number) =:= 0, test_to_div(N, Ints). test(Int) :- split_int_by_numbers(Int, Numbers), test_to_div(Int, Numbers), write(Int), write(" - Yes!"), nl.test(Int) :- write(Int), write(" - No!"), nl.?- read_int(Int), test(Int).
Program treygolnik;
Var
a,b,c: real;
begin
write('1 сторона треугольника: '); readln(a);
write('2 сторона треугольника: '); readln(b);
write('3 сторона треугольника: '); readln(c);
if (a<b+c) and (b<a+c) and (c<a+b) then
begin
writeln('Треугольник с данными сторонами построить можно');
if ((a=b) and (b<>c) and (a<>c)) or ((b=c) and (c<>a) and (b<>a)) or ((a=c) and (a<>b) and (c<>b))
then writeln('Этот треугольник равнобедренный');
end
else writeln('Треугольник с данными сторонами построить нельзя');
end.