2013-10-10 47 views

回答

2
$hex_value = <STDIN>; 
$decimal_value = hex $hex_value; 

說明:

  1. 要在從標準輸入讀取數據,使用<STDIN>;
  2. 要將十六進制值轉換爲十進制值,請使用hex;
1

讀輸入到一個標量,你通常會,比方說,$foo,並做到這一點:

$bar = hex($foo)