SHARE
TWEET

BAC2013_sc_polydivisible

M1RAI May 30th, 2020 1,046 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program polydivisible;
  2. uses WinCrt;
  3. var
  4. a,b:longint;
  5.  
  6. procedure saisie(var a,b:LongInt);
  7. begin
  8.         repeat
  9.                     write('a=');
  10.                     readln(a);
  11.                     write('b=');
  12.                     readln(b);
  13.         until   (a>=100) AND (a<b);
  14. end;
  15.  
  16. Procedure affiche(a,b:longint);
  17. var c:byte;
  18. i,x:longint;
  19. e:integer;
  20. chi,chicopy:string;
  21. nonpoly:Boolean;
  22. Begin
  23.         for i:=a to b do
  24.         begin
  25.                 str(i,chi);
  26.                 c:=2;
  27.                 repeat
  28.                             val(copy(chi,1,c),x,e);
  29.                             if x mod c = 0 then
  30.                             begin
  31.                                     c:=c+1;
  32.                                     nonpoly:=false;
  33.                             end
  34.                             else nonpoly:=true;
  35.                 until (c > length(chi)) OR nonpoly;
  36.                 if c > length(chi) then writeln(chi);
  37.         end;
  38. end;
  39.  
  40. begin
  41. saisie(a,b);
  42. affiche(a,b);
  43. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top