Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

dimanche 26 avril 2020

Baccalauréat 2014 Sujet 8 Corrigé

Program S8; Uses wincrt; Var A,B : Longint; //************************************** Procedure Saisie(Var A,B:longint); Begin Repeat write('Bornes de l''intervalle (>=100 : '); Readln(A,B); Until (A>=100) And (A<B); End; //************************************** Function Polydivisible (N:Longint) : Boolean; Var i,e : integer; x : longint; Poly : Boolean; ch,Test : String; Begin i := 2; STR(N,ch); Test := Ch[1]+ch[2]; VAL(Test,x,e); Poly := True; While (i<=Length(ch)) And (poly=true) Do Begin If (x Mod i = 0) Then Begin i := i+1; Test := Test+ch[i]; VAL(Test,x,e); End Else Poly := False; End; Polydivisible := Poly; End; //************************************** Procedure Affichage(A,B:longint); Var i : longint; Begin For i:=A To B Do Begin If (Polydivisible(i)) Then Begin writeln(i); READLN; End; End; End; //************************************** Begin Saisie(A,B); Affichage(A,B); End.
 
Back to top