Comment detail

倍数になる13進数 (Nested Flatten)
Adaで適当に
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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;

Index

Feed

Other

Link

Pathtraq

loading...