Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % SEND+MORE = MONEY
- include "alldifferent.mzn";
- var 1..9: S; var 1..9: M;
- var 0..9: E; var 0..9: N; var 0..9: D; var 0..9: O;var 0..9: R; var 0..9: Y;
- constraint 1000*S+100*E+10*N+ D + 1000*M+100*O+10*R+E = 10000*M+1000*O+100*N+10*E+Y;
- constraint alldifferent([S,M,E,N,D,R,O,Y]);
- solve satisfy;
- output ["S=\(S)\t M=\(M)\t E=\(E)\n",
- "N=\(N)\t D=\(D)\t O=\(O)\t R=\(R)\t Y=\(Y)\n", "\n"];
Add Comment
Please, Sign In to add comment