?? ans_155.pro
字號:
/*
Turbo Prolog 2.0, Answer to Exercise on page 155.
Copyright (c) 1986, 88 by Borland International, Inc
*/
% Uses backtracking to print all solutions to a query.
Predicates
country(symbol,real)
% (name ,population)
print_countries
Clauses
country(england,3e7).
country(france,2.3e7).
country(germany,1.6e7).
country(denmark,2.4e6).
country(canada,7.3e6).
country(chile,2.5e).
print_countries :-
country(X,P), /* bind country name to X and population to P */
P > 1e7, /* is population greater than 10 million? */
write(X), /* write the value of X */
nl, /* start a new line */
fail. /* force backtracking to find all solutions */
print_countries. /* make sure print_countries succeeds */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -