作业帮 > 综合 > 作业

send+more=money的pascal求解!

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/07 23:53:14
send+more=money的pascal求解!
send+more=money的pascal求解
题目应该是
...send
+.more
--------
.money
每个字母代表一个数字
求他们的值
program ex;
var
s,e,n,d,m,o,r,y,send,more,money:integer;
begin
for s:=1 to 9 do
for e:=0 to 9 do
for n:=0 to 9 do
for d:=0 to 9 do
for m:=1 to 9 do
for o:=0 to 9 do
for r:=0 to 9 do
for y:=0 to 9 do
begin
send:=s*1000+e*100+n*10+d;
more:=m*1000+o*100+r*10+e;
money:=m*10000+o*1000+n*100+e*10+y;
if money=send+more then
begin
writeln(' ',s,' ',e,' ',n,' ',d);
writeln('+',m,' ',o,' ',r,' ',e);
writeln('----------');
writeln(m,' ',o,' ',n' ',e,' 'y);
writeln;
end;
end;
end.