math
来源:互联网 发布:开淘宝店铺主要是什么 编辑:程序博客网 时间:2024/06/04 18:53
package math;public class MathDemo {public static void main(String[] args) {// 定义一个值5int a = 5;// 计算5的平方根System.out.println("5的平方根是:"+Math.sqrt(a));double x = 5.14;double y = 6.18;System.out.println("5.14的绝对值是:"+Math.abs(x));System.out.println("x和y比较大的是:"+Math.max(x, y));System.out.println("产生一个0,1之间的随机数"+Math.random());System.out.println("5的4次幂"+Math.pow(5, 4));System.out.println("产生10个[1,8]之间的随机数");for (int i = 0; i < 10; i++) {System.out.print((int)(Math.random()*8+1)+" ");}}}
阅读全文
0 0
- Math
- math
- Math
- Math
- Math
- Math
- math
- Math
- math
- Math
- Math
- Math
- Math
- Math
- Math
- Math
- Math
- Math
- Spring 乱码问题
- 我所知道的几种display:table-cell的应用
- 【USACO题库】3.2.4 Feed Ratios饲料调配
- 随笔杂谈
- python学习之 字符串前'r'的用法
- math
- 工作生活、写代码的程序员
- 苹果股价盘初下挫逾0.6% 新款iPhone即将发布
- iOS 自定义导航栏pop返回手势,全屏右滑返回
- ubuntu16.04
- 37、java常用类-Arrays
- iOS与Android 添加文字水印
- 关于防止短信炸弹的几种方法
- 文章标题