zoukankan      html  css  js  c++  java
  • perl进制转换

    十六进制数转换为十进制数

    $hexStr="0e";     print hex($hexStr);

    二进制数转换为十进制数

    print oct("0b"."10101010")."\n";

     十进制转换为二进制

     $Str = sprintf("%b","1432")+0;

    print $Str;

     十进制转换为十六进制

     $Str = sprintf("%x","14");     print $Str;

     十进制转换为八进制

     $Str = sprintf("%o","14");     print $Str;

  • 相关阅读:
    @codeforces
    @总结
    @总结
    @codeforces
    @topcoder
    @codeforces
    @codeforces
    @codeforces
    @codeforces
    @codeforces
  • 原文地址:https://www.cnblogs.com/blueicely/p/2888631.html
Copyright © 2011-2022 走看看