Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- predicates
- nondeterm nod(integer,integer,integer)
- clauses
- nod(X,X,X).
- nod(X,Y,Z) :- X<Y, Y1=Y-X, nod(X,Y1,Z).
- nod(X,Y,Z) :- X>Y, X1=X-Y, nod(X1,Y,Z).
- goal
- write("Chislo X?"), readint(X), write("Chislo Y ?"),readint(Y), nod(X,Y,Z), nl,write("NOD = ",Z),nl, nl.
Advertisement
Add Comment
Please, Sign In to add comment