Created
December 21, 2011 10:30
-
-
Save miura1729/1505540 to your computer and use it in GitHub Desktop.
情報オリンピック 問題1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rdat(Fn) :- see(Fn), | |
readln([X0]), | |
assert(pasta(X0)), | |
readln([X1]), | |
assert(pasta(X1)), | |
readln([X2]), | |
assert(pasta(X2)), | |
readln([X3]), | |
assert(juice(X3)), | |
readln([X4]), | |
assert(juice(X4)), | |
seen. | |
set_menu(RES) :- pasta(P), juice(J), Set is P + J - 50, set_menu(Set, RES). | |
set_menu(Rset, RES) :- pasta(P), juice(J), Set is P + J - 50, | |
Set < Rset, !, set_menu(Set, RES). | |
set_menu(Rset, Rset). | |
?- rdat('no1-3.dat'), set_menu(X), write(X). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment