80求解

P1618 三连击(升级版)

曦行夜落 @ 2017-09-27 19:21:31

var
  i,j,k,kase,ah,get,a,b,c,j1:longint;
  f:array[0..9] of longint;
begin
  readln(a,b,c);
  get:=0;
  for i:=1 to 999 do
    begin
      ah:=1;
      fillchar(f,sizeof(f),0);
      j1:=i*a; j:=i*b; k:=i*c;
      if ((j1>999) or (j div 1000)>0) or ((k div 1000)>0) then continue;
      f[j1 mod 10]:=1; f[j1 div 10 mod 10]:=1; f[j1 div 100]:=1;
      f[j mod 10]:=1; f[j div 10 mod 10]:=1; f[j div 100]:=1;
      f[k mod 10]:=1; f[k div 10 mod 10]:=1; f[k div 100]:=1;
      for kase:=1 to 9 do
        if f[kase]=0 then ah:=0;
      if ah=1 then
    begin
      get:=1;
      writeln(i,' ',j,' ',k);
    end;
      //write(get,' ',i mod 10,' ' ,i div 10 mod 10,' ',i div 100,' ',i);
      //write(' ',j mod 10,' ' ,j div 10 mod 10,' ',j div 100,' ',i);
      //writeln(' ',k mod 10,' ' ,k div 10 mod 10,' ',k div 100,' ',i);
    end;
  if get=0 then writeln('No!!!');
end.

by Luv_Letter @ 2017-10-05 00:31:59

第几个过不了?


|