
java算法总结
java算法汇集
屿汐学长
越努力越幸运。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
java算法总结-格式化输出浮点数篇二(利用format)
public class 圆的面积 {public static void main(String[] args) { Scanner sc = new Scanner(System.in); int r = sc.nextInt(); double area=r*r*Math.PI; //使用指定的格式字符串和参数返回格式化的字符串。 System.out.println...原创 2019-12-21 11:04:41 · 427 阅读 · 0 评论 -
java算法总结-格式化输出浮点数篇一(利用printf)
1.格式化输出浮点数代码:public class 格式化输出浮点数 {public static void main(String[] args) {double s = 0.123456789;System.out.printf("%6.3f",s);//或//System.out.print(String.format("%6.3f",s));}}解释:%6.3f: ...原创 2019-12-21 10:55:42 · 1488 阅读 · 0 评论