fork download
  1. With Ada.Text_IO; Use Ada.Text_IO;
  2. With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
  3.  
  4. procedure Program is
  5. type Binary_array is array(0..99) of Integer;
  6. type Decimal_array is array(0..33) of Integer;
  7. bin: Binary_array;
  8. dec: Decimal_array;
  9. dec_len: Integer := 0;
  10. num: Integer := 0;
  11. char: String := "A";
  12. begin
  13. -- your code goes here
  14. for i in 0..99 loop
  15. get(char);
  16. if char = "0" then
  17. bin(i) := 0;
  18. else
  19. bin(i) := 1;
  20. end if;
  21. end loop;
  22.  
  23. for i in 0..33 loop
  24. num := 0;
  25. for j in 0..99 loop
  26. num := num * 2;
  27. num := num + bin(j);
  28. bin(j) := num / 10;
  29. num := num rem 10;
  30. end loop;
  31.  
  32. dec(i) := num;
  33. end loop;
  34.  
  35. for i in 0..33 loop
  36. put(dec(33 - i), 0);
  37. end loop;
  38. end Program;
Success #stdin #stdout 0s 5820KB
stdin
0101001000111001110100011100011101011101101111101101010011011111100001000000110111111101101000010000
stdout
0000407162723669126247520021764624