四则运算
来源:互联网 发布:云计算公司是干什么的 编辑:程序博客网 时间:2024/04/29 07:13
import java.util.Random;
public class activity_main{
private static String[] operation = {"+","-","*","/"};
private static Random random = new Random();
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("*******四则运算:*******");
for(int i = 0; i < 20; i++) {
String str = "";
for (int j = 0; j < 4; j++) {//循环操作
int num = random.nextInt(100);
int index = random.nextInt(4);
str += num;
str += operation[index];
}
str += random.nextInt(100);
System.out.println("("+(i+1)+") "+str);
}
}
public class activity_main{
private static String[] operation = {"+","-","*","/"};
private static Random random = new Random();
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("*******四则运算:*******");
for(int i = 0; i < 20; i++) {
String str = "";
for (int j = 0; j < 4; j++) {//循环操作
int num = random.nextInt(100);
int index = random.nextInt(4);
str += num;
str += operation[index];
}
str += random.nextInt(100);
System.out.println("("+(i+1)+") "+str);
}
}
0 0
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 四则运算
- 面试时绝对不能说的13句话
- Java_ImageIO(图像处理)
- 当jsp页面显示JAVA代码
- 【解决】hive跑批后presto未同步源数据的问题
- 浅析软件项目管理中十个误区
- 四则运算
- 项目管理缩略语英中注释表
- Oracle Function GetWeek(获取当前时间是第几周,周天为第一天)
- 数据库常用函数
- jQuery_序列化表单数据 serialize() serializeArray()
- 【Python学习笔记】-Python思维导图合集【持续更新】
- 关于代码审查的几点建议
- Vim_大小写转换
- Vim_delete