Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- predicates
- nondeterm a(integer,integer,integer)
- clauses
- a(0,W,E):-write("Summa cifr = ",E),!.
- a(Q,W,E):- E1 = E*(Q mod 10) , Q1 = Q div 10 , W1 = W*10 , a(Q1,W1,E1).
- goal
- write("Chislo?"), readint(Q) , a(Q,10,1), nl.
Advertisement
Add Comment
Please, Sign In to add comment