Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
14
Task/Twos-complement/Prolog/twos-complement.pro
Normal file
14
Task/Twos-complement/Prolog/twos-complement.pro
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
d(1234567).
|
||||
|
||||
b([-D, -D + 1, -2, -1, 0, 1, 2, D - 2, D - 1]) :-
|
||||
d(D).
|
||||
|
||||
print_array([]).
|
||||
print_array([H|T]) :-
|
||||
NegH is -H,
|
||||
format('~d -> ~d~n', [H, NegH]),
|
||||
print_array(T).
|
||||
|
||||
main :-
|
||||
b(B),
|
||||
print_array(B).
|
||||
Loading…
Add table
Add a link
Reference in a new issue