-- verifier existence produit bugge with Ada.Text_Io; use Ada.Text_Io; with Ada.Integer_Text_Io; use Ada.Integer_Text_Io; procedure Oli1 is A : String (1 .. 10); A : String (1 .. 10); B : boolean; C : Integer; D : Integer; Lasta2 : Integer; Last : Natural; I : Integer; Char : Boolean; J : Integer; begin -- Get_Line (A, C); A :="0000100010"; A -- on veut que si on trouve au moins une fois 1 dans la chaine ci dessus la procedure renvoie VRAI, si elle a jamais trouvé de 1 dans la chaine, elle renvoie FAUX put ("avec mon truc"); I:=1; b:=false; while I<=10 loop if A1(I)="1" then B:=True; else if B=False then B:=False; end if; end if; i:=i+1; end loop; if B=True then Put ("B est vrai"); else Put ("B est faux"); end if; -- maintenant, sans le if bidule truc. put ("sans mon truc"); I:=1; b:=false; while I<=10 loop if A1(I)="1" then B:=True; else B:=False; end if; i:=i+1; end loop; if B=True then Put ("B est vrai"); else Put ("B est faux"); end if; end oli1;