|
|
back to boardwho can find out my mistake? Posted by free 15 Jun 2006 21:03 program timus; var a,b,c:string; procedure solving; var i,j:longint; check:boolean; d:char; begin check:=false; c:=''; c:=c+b[1]+b[2]+b[3]+b[4]; for i:=1 to 4 do begin d:=c[2]; c[2]:=c[3]; c[3]:=c[4]; c[4]:=d; if c=a then check:=true; end; c:=''; c:=c+b[2]+b[3]+b[1]+b[4]; for i:=1 to 4 do begin d:=c[2]; c[2]:=c[3]; c[3]:=c[4]; c[4]:=d; if c=a then check:=true; end; c:=''; c:=c+b[3]+b[1]+b[2]+b[4]; for i:=1 to 4 do begin d:=c[2]; c[2]:=c[3]; c[3]:=c[4]; c[4]:=d; if c=a then check:=true; end; c:=''; c:=c+b[4]+b[2]+b[3]+b[1]; for i:=1 to 4 do begin d:=c[2]; c[2]:=c[3]; c[3]:=c[4]; c[4]:=d; if c=a then check:=true; end; if check=true then writeln('equal') else writeln('different'); end; begin readln(a); readln(b); SOLVING; end. Re: who can find out my mistake? c:=c+b[4]+b[2]+b[1]+b[3]; |
|
|