目前printf支持以下格式: %c 单个字符%d 十进制整数%f 十进制浮点数%o 八进制数%s 字符串%u 无符号 ... System.out.printf("%f", d); // "f"表示格式化输出浮点数。
確定! 回上一頁