- 最后登录
- 2021-12-9
- 在线时间
- 496 小时
- 阅读权限
- 40
- 注册时间
- 2009-3-22
- 积分
- 1718
- 帖子
- 1420
- 精华
- 0
- UID
- 82443
- 性别
- 男
- 积分
- 1718
- 帖子
- 1420
- 精华
- 0
- UID
- 82443
- 性别
- 男
- 居住地
- 西安市
|
回复 20# 的帖子
program ex;
var
a,b,c,d,e,f,g,h,i:integer;
begin
for a:=1 to 9 do
for b:=1 to 9 do
if b<>a then
for c:=1 to 9 do
if(c<>a)and(c<>b)then
for d:=1 to 9 do
if(d<>a)and(d<>b)and(d<>c)then
for e:=1 to 9 do
if(e<>a)and(e<>b)and(e<>c)and(e<>d)then
for f:=1 to 9 do
if(f<>a)and(f<>b)and(f<>c)and(f<>d)and(f<>e)then
for g:=1 to 9 do
if(g<>a)and(g<>b)and(g<>c)and(g<>d)and(g<>e)and(g<>f)then
for h:=1 to 9 do
if(h<>a)and(h<>b)and(h<>c)and(h<>d)and(h<>e)and(h<>f)and(h<>g)then
for i:=1 to 9 do
if(i<>a)and(i<>b)and(i<>c)and(i<>d)and(i<>e)and(i<>f)and(i<>g)and(i<>h)then
if a/(10*b+c)+d/(10*e+f)+g/(10*h+i)=1 then
writeln(a,'/',10*b+c,'+',d,'/',10*e+f,'+',g,'/',10*h+i,'=1');
readln;
readln;
end.
pascal 穷举 |
|