with Ada.Text_Io;
procedure Twice is
begin
for I in 10..10000 loop
declare
Str:String:=Integer'Image(I);
Num:Natural:=Natural'Value("13#"&Str(Str'First+1..Str'Last)&"#");
begin
if Num=I*2 then
Ada.Text_Io.Put_Line(Integer'Image(I)&" => "&Integer'Image(Num));
end if;
end;
end loop;
end Twice;
zubenalt #5932() [ Other ] Rating0/0=0.00
with Ada.Text_Io; procedure Twice is begin for I in 10..10000 loop declare Str:String:=Integer'Image(I); Num:Natural:=Natural'Value("13#"&Str(Str'First+1..Str'Last)&"#"); begin if Num=I*2 then Ada.Text_Io.Put_Line(Integer'Image(I)&" => "&Integer'Image(Num)); end if; end; end loop; end Twice;Rating0/0=0.00-0+
[ reply ]