2009年2月17日 星期二

第143題

Given:
System.out.printf("Pi is approximately %f and E is approximately %b, Math.PI, Math.E);
Place the values where they would appear in the output.
答案:
Pi is approximately 3.141593
and E is approximately true
參考:10-2 Console類別、11-1 數字類型
----------------------------------------
%f 格式化 Math.PI , float
%b 格式化 Math.E , 除非是布林值的 false, 不然就是true.

沒有留言:

張貼留言